Changeset View
Changeset View
Standalone View
Standalone View
sbin/dhclient/bpf.c
Show First 20 Lines • Show All 84 Lines • ▼ Show 20 Lines | if (sock < 0) { | ||||
break; | break; | ||||
} | } | ||||
/* Set the BPF device to point at this interface. */ | /* Set the BPF device to point at this interface. */ | ||||
if (ioctl(sock, BIOCSETIF, info->ifp) < 0) | if (ioctl(sock, BIOCSETIF, info->ifp) < 0) | ||||
error("Can't attach interface %s to bpf device %s: %m", | error("Can't attach interface %s to bpf device %s: %m", | ||||
info->name, filename); | info->name, filename); | ||||
/* Tag the packets with the proper VLAN PCP setting. */ | |||||
if (info->client->config->vlan_pcp != 0) { | |||||
if (ioctl(sock, BIOCSETVLANPCP, | |||||
&info->client->config->vlan_pcp) < 0) | |||||
error( "Can't set the VLAN PCP tag on interface %s: %m", | |||||
info->name); | |||||
} | |||||
return (sock); | return (sock); | ||||
} | } | ||||
/* | /* | ||||
* Packet write filter program: | * Packet write filter program: | ||||
* 'ip and udp and src port bootps and dst port (bootps or bootpc)' | * 'ip and udp and src port bootps and dst port (bootps or bootpc)' | ||||
*/ | */ | ||||
static struct bpf_insn dhcp_bpf_wfilter[] = { | static struct bpf_insn dhcp_bpf_wfilter[] = { | ||||
▲ Show 20 Lines • Show All 389 Lines • Show Last 20 Lines |