Commit graph

12 commits

Author SHA1 Message Date
Warner Losh 1d386b48a5 Remove $FreeBSD$: one-line .c pattern
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
2023-08-16 11:54:42 -06:00
Rob Norris 461ccb55d5 dhclient: add ability to ignore options in offers
A machine might exist on multiple networks, all of which offer, say, default
routes or name servers. There's no easy way to indicate in the config
that those options are only valid for a single interface.

Now, we can write:

    interface "lan0" {
      request routers;
      require routers;
    }
    interface "lan1" {
      ignore routers;
    }

And only take action on default routes offered on lan0.

Tested by:	Jose Luis Duran <jlduran at gmail dot com>
MFC after:	2 months
Reviewed by:	allanjude, imp
Sponsored by:	Zenith Electronics LLC
Sponsored by:	Klara, Inc.
Pull Request:	#693
2023-04-10 23:13:18 +00:00
Luiz Otavio O Souza 1e7fe2fbb9 bpf: Add an ioctl to set the VLAN Priority on packets sent by bpf
This allows the use of VLAN PCP in dhclient, which is required for
certain ISPs (such as Orange.fr).

Reviewed by:	bcr (man page)
MFC after:	1 week
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D31263
2021-07-26 23:13:31 +02:00
Eitan Adler 71c6c44d8d dhclient: build with WARNS=6
- add static in a number of places
- initialize __progname rather than rely on magical extern values
- use nitems() instead of manually spelling it out
- unshadow 'idi'
- teach 'error' that it is '__dead2'
- add missing 'break'
2018-06-24 13:23:27 +00:00
Alan Somers 79a1d19516 dhclient: raise WARNS to 4
Mostly const-correctness fixes. There were also some variable-shadowing,
unused variable, and a couple of sockaddr type-correctness changes. I also had
trouble with cast-align warnings. I was able to prove that one of them was a
false positive. But ultimately I had to disable the warning program-wide to
deal with the others.

Reviewed by:	cem
MFC after:	3 weeks
Sponsored by:	Spectra Logic Corp
Differential Revision:	https://reviews.freebsd.org/D14460
2018-02-21 21:13:08 +00:00
Alan Somers afe6f8358e dhclient(8): raise WARNS to 3
Mostly had to fix a lot of signed/unsigned comparison warnings

MFC after:	3 weeks
Sponsored by:	Spectra Logic Corp
2017-12-14 15:41:32 +00:00
Pedro F. Giffuni 8a16b7a18f General further adoption of SPDX licensing ID tags.
Mainly focus on files that use BSD 3-Clause license.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.

Special thanks to Wind River for providing access to "The Duke of
Highlander" tool: an older (2014) run over FreeBSD tree was useful as a
starting point.
2017-11-20 19:49:47 +00:00
Pedro F. Giffuni 32ceeb31a1 dhclient(1): correct obvious mismatch in get_char().
Correct switch between current and previous line buffers when
encountering a carriage return in the input.

CID:		1305719
Obtained from:	OpenBSD (CVS rev. 1.30)
MFC after:	3 days
2016-06-03 03:40:39 +00:00
Brooks Davis 753d6c0327 In read_string(), when the last character was a backslash, unincrement
the output index instead of keeping what ever trash was in the buffer.

Reported by:	iedowse
2005-08-26 01:25:59 +00:00
Brooks Davis 1469b42c7d MFOpenBSD rev 1.9: fix a buffer overflow when processing config file
lines that are exactly 81 characters in length.

Obtained from:	OpenBSD
MFC After:	3 days
2005-08-24 00:05:04 +00:00
Brooks Davis 8794fdbb48 Add __FBSDID to all .c files in dhclient to aid in determining file
versions when dealing with user problems.
2005-08-23 23:59:55 +00:00
Brooks Davis 47c0859616 Import the OpenBSD dhclient as shipped with OpenBSD-3.7 (the tag
OPENBSD_3_7).
2005-06-07 04:05:09 +00:00