mirror of
https://github.com/rsmarples/dhcpcd.git
synced 2024-11-24 18:44:10 +08:00
Set the broadcast flag for interfaces that say they need it.
This commit is contained in:
parent
fdbeed3d2b
commit
d274a5320b
3
dhcpcd.c
3
dhcpcd.c
@ -765,6 +765,9 @@ configure_interface1(struct interface *iface)
|
|||||||
uint8_t *duid;
|
uint8_t *duid;
|
||||||
size_t len = 0, ifl;
|
size_t len = 0, ifl;
|
||||||
|
|
||||||
|
/* Do any platform specific configuration */
|
||||||
|
if_conf(iface);
|
||||||
|
|
||||||
if (iface->flags & IFF_POINTOPOINT && !(ifo->options & DHCPCD_INFORM))
|
if (iface->flags & IFF_POINTOPOINT && !(ifo->options & DHCPCD_INFORM))
|
||||||
ifo->options |= DHCPCD_STATIC;
|
ifo->options |= DHCPCD_STATIC;
|
||||||
if (iface->flags & IFF_NOARP ||
|
if (iface->flags & IFF_NOARP ||
|
||||||
|
7
if-bsd.c
7
if-bsd.c
@ -79,6 +79,13 @@ if_init(_unused struct interface *iface)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
if_conf(_unused struct interface *iface)
|
||||||
|
{
|
||||||
|
/* No extra checks needed on BSD */
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
init_sockets(void)
|
init_sockets(void)
|
||||||
{
|
{
|
||||||
|
20
if-linux.c
20
if-linux.c
@ -85,6 +85,26 @@ if_init(struct interface *iface)
|
|||||||
return n == -1 ? -1 : 0;
|
return n == -1 ? -1 : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
if_conf(struct interface *iface)
|
||||||
|
{
|
||||||
|
char path[PATH_MAX], buf[1];
|
||||||
|
FILE *fp;
|
||||||
|
|
||||||
|
/* Some qeth setups require the use of the broadcast flag. */
|
||||||
|
snprintf(path, sizeof(path),
|
||||||
|
"/sys/class/net/%s/device/layer2",
|
||||||
|
iface->name);
|
||||||
|
|
||||||
|
fp = fopen(path, "r");
|
||||||
|
if (fp == NULL)
|
||||||
|
return errno == ENOENT ? 0 : -1;
|
||||||
|
if (fgets(buf, sizeof(buf), fp) != NULL && buf[0] == '0')
|
||||||
|
iface->state->options->options |= DHCPCD_BROADCAST;
|
||||||
|
fclose(fp);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
_open_link_socket(struct sockaddr_nl *nl)
|
_open_link_socket(struct sockaddr_nl *nl)
|
||||||
{
|
{
|
||||||
|
1
net.h
1
net.h
@ -105,6 +105,7 @@ int inet_ntocidr(struct in_addr);
|
|||||||
int inet_cidrtoaddr(int, struct in_addr *);
|
int inet_cidrtoaddr(int, struct in_addr *);
|
||||||
|
|
||||||
int up_interface(struct interface *);
|
int up_interface(struct interface *);
|
||||||
|
int if_conf(struct interface *);
|
||||||
int if_init(struct interface *);
|
int if_init(struct interface *);
|
||||||
|
|
||||||
int do_address(const char *,
|
int do_address(const char *,
|
||||||
|
Loading…
Reference in New Issue
Block a user