mirror of
https://git.rtems.org/rtems-libbsd/
synced 2025-10-14 06:35:01 +08:00
Update to FreeBSD head 2018-02-01
Git mirror commit d079ae0442af8fa3cfd6d7ede190d04e64a2c0d4. Update #3472.
This commit is contained in:
@@ -298,12 +298,12 @@ parse_client_statement(FILE *cfile, struct interface_info *ip,
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
parse_X(FILE *cfile, u_int8_t *buf, int max)
|
||||
unsigned
|
||||
parse_X(FILE *cfile, u_int8_t *buf, unsigned max)
|
||||
{
|
||||
int token;
|
||||
char *val;
|
||||
int len;
|
||||
unsigned len;
|
||||
|
||||
token = peek_token(&val, cfile);
|
||||
if (token == NUMBER_OR_NAME || token == NUMBER) {
|
||||
@@ -687,14 +687,14 @@ parse_option_decl(FILE *cfile, struct option_data *options)
|
||||
int token;
|
||||
u_int8_t buf[4];
|
||||
u_int8_t hunkbuf[1024];
|
||||
int hunkix = 0;
|
||||
unsigned hunkix = 0;
|
||||
char *vendor;
|
||||
char *fmt;
|
||||
struct universe *universe;
|
||||
struct option *option;
|
||||
struct iaddr ip_addr;
|
||||
u_int8_t *dp;
|
||||
int len;
|
||||
unsigned len;
|
||||
int nul_term = 0;
|
||||
|
||||
token = next_token(&val, cfile);
|
||||
|
@@ -62,8 +62,8 @@ int eol_token;
|
||||
|
||||
static char line1[81];
|
||||
static char line2[81];
|
||||
static int lpos;
|
||||
static int line;
|
||||
static unsigned lpos;
|
||||
static unsigned line;
|
||||
static int tlpos;
|
||||
static int tline;
|
||||
static int token;
|
||||
@@ -230,7 +230,8 @@ skip_to_eol(FILE *cfile)
|
||||
static int
|
||||
read_string(FILE *cfile)
|
||||
{
|
||||
int i, c, bs = 0;
|
||||
int c, bs = 0;
|
||||
unsigned i;
|
||||
|
||||
for (i = 0; i < sizeof(tokbuf); i++) {
|
||||
c = get_char(cfile);
|
||||
@@ -265,7 +266,8 @@ read_string(FILE *cfile)
|
||||
static int
|
||||
read_number(int c, FILE *cfile)
|
||||
{
|
||||
int seenx = 0, i = 0, token = NUMBER;
|
||||
int seenx = 0, token = NUMBER;
|
||||
unsigned i = 0;
|
||||
|
||||
tokbuf[i++] = c;
|
||||
for (; i < sizeof(tokbuf); i++) {
|
||||
@@ -292,7 +294,7 @@ read_number(int c, FILE *cfile)
|
||||
static int
|
||||
read_num_or_name(int c, FILE *cfile)
|
||||
{
|
||||
int i = 0;
|
||||
unsigned i = 0;
|
||||
int rv = NUMBER_OR_NAME;
|
||||
|
||||
tokbuf[i++] = c;
|
||||
|
@@ -152,7 +152,7 @@ int
|
||||
findproto(char *cp, int n)
|
||||
{
|
||||
struct sockaddr *sa;
|
||||
int i;
|
||||
unsigned i;
|
||||
|
||||
if (n == 0)
|
||||
return -1;
|
||||
@@ -182,7 +182,7 @@ struct sockaddr *
|
||||
get_ifa(char *cp, int n)
|
||||
{
|
||||
struct sockaddr *sa;
|
||||
int i;
|
||||
unsigned i;
|
||||
|
||||
if (n == 0)
|
||||
return (NULL);
|
||||
@@ -197,7 +197,7 @@ get_ifa(char *cp, int n)
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
struct iaddr defaddr = { 4 };
|
||||
struct iaddr defaddr = { .len = 4 };
|
||||
uint8_t curbssid[6];
|
||||
|
||||
static void
|
||||
@@ -239,7 +239,8 @@ routehandler(struct protocol *p)
|
||||
|
||||
n = read(routefd, &msg, sizeof(msg));
|
||||
rtm = (struct rt_msghdr *)msg;
|
||||
if (n < sizeof(rtm->rtm_msglen) || n < rtm->rtm_msglen ||
|
||||
if (n < (ssize_t)sizeof(rtm->rtm_msglen) ||
|
||||
n < (ssize_t)rtm->rtm_msglen ||
|
||||
rtm->rtm_version != RTM_VERSION)
|
||||
return;
|
||||
|
||||
@@ -2061,7 +2062,8 @@ priv_script_write_params(char *prefix, struct client_lease *lease)
|
||||
{
|
||||
struct interface_info *ip = ifi;
|
||||
u_int8_t dbuf[1500], *dp = NULL;
|
||||
int i, len;
|
||||
int i;
|
||||
size_t len;
|
||||
char tbuf[128];
|
||||
|
||||
script_set_env(ip->client, prefix, "ip_address",
|
||||
@@ -2211,12 +2213,14 @@ script_write_params(char *prefix, struct client_lease *lease)
|
||||
pr_len = strlen(prefix);
|
||||
|
||||
hdr.code = IMSG_SCRIPT_WRITE_PARAMS;
|
||||
hdr.len = sizeof(hdr) + sizeof(struct client_lease) +
|
||||
sizeof(size_t) + fn_len + sizeof(size_t) + sn_len +
|
||||
sizeof(size_t) + pr_len;
|
||||
hdr.len = sizeof(hdr) + sizeof(*lease) +
|
||||
sizeof(fn_len) + fn_len + sizeof(sn_len) + sn_len +
|
||||
sizeof(pr_len) + pr_len;
|
||||
|
||||
for (i = 0; i < 256; i++)
|
||||
hdr.len += sizeof(int) + lease->options[i].len;
|
||||
for (i = 0; i < 256; i++) {
|
||||
hdr.len += sizeof(lease->options[i].len);
|
||||
hdr.len += lease->options[i].len;
|
||||
}
|
||||
|
||||
scripttime = time(NULL);
|
||||
|
||||
@@ -2225,7 +2229,7 @@ script_write_params(char *prefix, struct client_lease *lease)
|
||||
|
||||
errs = 0;
|
||||
errs += buf_add(buf, &hdr, sizeof(hdr));
|
||||
errs += buf_add(buf, lease, sizeof(struct client_lease));
|
||||
errs += buf_add(buf, lease, sizeof(*lease));
|
||||
errs += buf_add(buf, &fn_len, sizeof(fn_len));
|
||||
errs += buf_add(buf, lease->filename, fn_len);
|
||||
errs += buf_add(buf, &sn_len, sizeof(sn_len));
|
||||
@@ -2330,7 +2334,8 @@ void
|
||||
script_set_env(struct client_state *client, const char *prefix,
|
||||
const char *name, const char *value)
|
||||
{
|
||||
int i, j, namelen;
|
||||
int i, namelen;
|
||||
size_t j;
|
||||
|
||||
/* No `` or $() command substitution allowed in environment values! */
|
||||
for (j=0; j < strlen(value); j++)
|
||||
@@ -2398,7 +2403,7 @@ script_flush_env(struct client_state *client)
|
||||
int
|
||||
dhcp_option_ev_name(char *buf, size_t buflen, struct option *option)
|
||||
{
|
||||
int i;
|
||||
size_t i;
|
||||
|
||||
for (i = 0; option->name[i]; i++) {
|
||||
if (i + 1 == buflen)
|
||||
|
@@ -85,7 +85,7 @@
|
||||
#define REMOTE_PORT 67
|
||||
|
||||
struct option_data {
|
||||
int len;
|
||||
size_t len;
|
||||
u_int8_t *data;
|
||||
};
|
||||
|
||||
@@ -95,7 +95,7 @@ struct string_list {
|
||||
};
|
||||
|
||||
struct iaddr {
|
||||
int len;
|
||||
size_t len;
|
||||
unsigned char iabuf[16];
|
||||
};
|
||||
|
||||
@@ -288,9 +288,9 @@ char *parse_string(FILE *);
|
||||
int parse_ip_addr(FILE *, struct iaddr *);
|
||||
void parse_hardware_param(FILE *, struct hardware *);
|
||||
void parse_lease_time(FILE *, time_t *);
|
||||
unsigned char *parse_numeric_aggregate(FILE *, unsigned char *, int *,
|
||||
int, int, int);
|
||||
void convert_num(unsigned char *, char *, int, int);
|
||||
unsigned char *parse_numeric_aggregate(FILE *, unsigned char *, size_t *,
|
||||
int, unsigned, int);
|
||||
void convert_num(unsigned char *, char *, unsigned, int);
|
||||
time_t parse_date(FILE *);
|
||||
|
||||
/* tree.c */
|
||||
@@ -427,7 +427,7 @@ int read_client_conf(void);
|
||||
void read_client_leases(void);
|
||||
void parse_client_statement(FILE *, struct interface_info *,
|
||||
struct client_config *);
|
||||
int parse_X(FILE *, u_int8_t *, int);
|
||||
unsigned parse_X(FILE *, u_int8_t *, unsigned);
|
||||
int parse_option_list(FILE *, u_int8_t *);
|
||||
void parse_interface_declaration(FILE *, struct client_config *);
|
||||
struct interface_info *interface_or_dummy(char *);
|
||||
|
@@ -58,7 +58,7 @@ struct iaddr
|
||||
subnet_number(struct iaddr addr, struct iaddr mask)
|
||||
{
|
||||
struct iaddr rv;
|
||||
int i;
|
||||
unsigned i;
|
||||
|
||||
rv.len = 0;
|
||||
|
||||
@@ -81,7 +81,7 @@ struct iaddr
|
||||
broadcast_addr(struct iaddr subnet, struct iaddr mask)
|
||||
{
|
||||
struct iaddr rv;
|
||||
int i;
|
||||
unsigned i;
|
||||
|
||||
if (subnet.len != mask.len) {
|
||||
rv.len = 0;
|
||||
|
@@ -57,11 +57,11 @@ int bad_options_max = 5;
|
||||
|
||||
void parse_options(struct packet *);
|
||||
void parse_option_buffer(struct packet *, unsigned char *, int);
|
||||
int store_options(unsigned char *, int, struct tree_cache **,
|
||||
unsigned store_options(unsigned char *, int, struct tree_cache **,
|
||||
unsigned char *, int, int, int, int);
|
||||
void expand_domain_search(struct packet *packet);
|
||||
int find_search_domain_name_len(struct option_data *option, int *offset);
|
||||
void expand_search_domain_name(struct option_data *option, int *offset,
|
||||
int find_search_domain_name_len(struct option_data *option, size_t *offset);
|
||||
void expand_search_domain_name(struct option_data *option, size_t *offset,
|
||||
unsigned char **domain_search);
|
||||
|
||||
|
||||
@@ -215,7 +215,8 @@ parse_option_buffer(struct packet *packet,
|
||||
void
|
||||
expand_domain_search(struct packet *packet)
|
||||
{
|
||||
int offset, expanded_len, next_domain_len;
|
||||
size_t offset;
|
||||
int expanded_len, next_domain_len;
|
||||
struct option_data *option;
|
||||
unsigned char *domain_search, *cursor;
|
||||
|
||||
@@ -259,9 +260,10 @@ expand_domain_search(struct packet *packet)
|
||||
}
|
||||
|
||||
int
|
||||
find_search_domain_name_len(struct option_data *option, int *offset)
|
||||
find_search_domain_name_len(struct option_data *option, size_t *offset)
|
||||
{
|
||||
int domain_name_len, i, label_len, pointer, pointed_len;
|
||||
int domain_name_len, label_len, pointed_len;
|
||||
size_t i, pointer;
|
||||
|
||||
domain_name_len = 0;
|
||||
|
||||
@@ -326,10 +328,11 @@ find_search_domain_name_len(struct option_data *option, int *offset)
|
||||
}
|
||||
|
||||
void
|
||||
expand_search_domain_name(struct option_data *option, int *offset,
|
||||
expand_search_domain_name(struct option_data *option, size_t *offset,
|
||||
unsigned char **domain_search)
|
||||
{
|
||||
int i, label_len, pointer;
|
||||
int label_len;
|
||||
size_t i, pointer;
|
||||
unsigned char *cursor;
|
||||
|
||||
/*
|
||||
@@ -383,8 +386,10 @@ cons_options(struct packet *inpacket, struct dhcp_packet *outpacket,
|
||||
int terminate, int bootpp, u_int8_t *prl, int prl_len)
|
||||
{
|
||||
unsigned char priority_list[300], buffer[4096];
|
||||
int priority_len, main_buffer_size, mainbufix, bufix;
|
||||
int option_size, length;
|
||||
unsigned priority_len;
|
||||
size_t main_buffer_size;
|
||||
unsigned option_size, bufix, mainbufix;
|
||||
int length;
|
||||
|
||||
/*
|
||||
* If the client has provided a maximum DHCP message size, use
|
||||
@@ -426,7 +431,7 @@ cons_options(struct packet *inpacket, struct dhcp_packet *outpacket,
|
||||
*/
|
||||
if (inpacket &&
|
||||
inpacket->options[DHO_DHCP_PARAMETER_REQUEST_LIST].data) {
|
||||
int prlen =
|
||||
unsigned prlen =
|
||||
inpacket->options[DHO_DHCP_PARAMETER_REQUEST_LIST].len;
|
||||
if (prlen + priority_len > sizeof(priority_list))
|
||||
prlen = sizeof(priority_list) - priority_len;
|
||||
@@ -520,7 +525,7 @@ cons_options(struct packet *inpacket, struct dhcp_packet *outpacket,
|
||||
/*
|
||||
* Store all the requested options into the requested buffer.
|
||||
*/
|
||||
int
|
||||
unsigned
|
||||
store_options(unsigned char *buffer, int buflen, struct tree_cache **options,
|
||||
unsigned char *priority_list, int priority_len, int first_cutoff,
|
||||
int second_cutoff, int terminate)
|
||||
|
@@ -62,7 +62,7 @@ u_int32_t wrapsum(u_int32_t);
|
||||
u_int32_t
|
||||
checksum(unsigned char *buf, unsigned nbytes, u_int32_t sum)
|
||||
{
|
||||
int i;
|
||||
unsigned i;
|
||||
|
||||
/* Checksum all the pairs of bytes first... */
|
||||
for (i = 0; i < (nbytes & ~1U); i += 2) {
|
||||
|
@@ -47,6 +47,8 @@
|
||||
#include <sys/cdefs.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
#include "dhcpd.h"
|
||||
#include "dhctoken.h"
|
||||
|
||||
@@ -160,7 +162,8 @@ void
|
||||
parse_hardware_param(FILE *cfile, struct hardware *hardware)
|
||||
{
|
||||
unsigned char *t;
|
||||
int token, hlen;
|
||||
int token;
|
||||
size_t hlen;
|
||||
char *val;
|
||||
|
||||
token = next_token(&val, cfile);
|
||||
@@ -244,13 +247,13 @@ parse_lease_time(FILE *cfile, time_t *timep)
|
||||
* tokenized.
|
||||
*/
|
||||
unsigned char *
|
||||
parse_numeric_aggregate(FILE *cfile, unsigned char *buf, int *max,
|
||||
int separator, int base, int size)
|
||||
parse_numeric_aggregate(FILE *cfile, unsigned char *buf, size_t *max,
|
||||
int separator, unsigned base, int size)
|
||||
{
|
||||
unsigned char *bufp = buf, *s = NULL;
|
||||
int token, count = 0;
|
||||
int token;
|
||||
char *val, *t;
|
||||
size_t valsize;
|
||||
size_t valsize, count = 0;
|
||||
pair c = NULL;
|
||||
unsigned char *lbufp = NULL;
|
||||
|
||||
@@ -331,14 +334,15 @@ parse_numeric_aggregate(FILE *cfile, unsigned char *buf, int *max,
|
||||
}
|
||||
|
||||
void
|
||||
convert_num(unsigned char *buf, char *str, int base, int size)
|
||||
convert_num(unsigned char *buf, char *str, unsigned base, int size)
|
||||
{
|
||||
int negative = 0, tval, max;
|
||||
bool negative = false;
|
||||
unsigned tval, max;
|
||||
u_int32_t val = 0;
|
||||
char *ptr = str;
|
||||
|
||||
if (*ptr == '-') {
|
||||
negative = 1;
|
||||
negative = true;
|
||||
ptr++;
|
||||
}
|
||||
|
||||
|
@@ -78,7 +78,8 @@ buf_close(int sock, struct buf *buf)
|
||||
ssize_t
|
||||
buf_read(int sock, void *buf, size_t nbytes)
|
||||
{
|
||||
ssize_t n, r = 0;
|
||||
ssize_t n;
|
||||
size_t r = 0;
|
||||
char *p = buf;
|
||||
|
||||
do {
|
||||
@@ -86,7 +87,7 @@ buf_read(int sock, void *buf, size_t nbytes)
|
||||
if (n == 0)
|
||||
error("connection closed");
|
||||
if (n != -1) {
|
||||
r += n;
|
||||
r += (size_t)n;
|
||||
p += n;
|
||||
nbytes -= n;
|
||||
}
|
||||
@@ -109,9 +110,9 @@ dispatch_imsg(struct interface_info *ifi, int fd)
|
||||
char *medium, *reason, *filename,
|
||||
*servername, *prefix;
|
||||
size_t medium_len, reason_len, filename_len,
|
||||
servername_len, prefix_len, totlen;
|
||||
servername_len, optlen, prefix_len, totlen;
|
||||
struct client_lease lease;
|
||||
int ret, i, optlen;
|
||||
int ret, i;
|
||||
struct buf *buf;
|
||||
u_int16_t mtu;
|
||||
|
||||
|
@@ -49,8 +49,6 @@ __FBSDID("$FreeBSD$");
|
||||
|
||||
#include "dhcpd.h"
|
||||
|
||||
extern int h_errno;
|
||||
|
||||
pair
|
||||
cons(caddr_t car, pair cdr)
|
||||
{
|
||||
|
@@ -88,7 +88,7 @@ struct _nv {
|
||||
const char *find_value(struct _nv *x, int value);
|
||||
const char *find_zero_bit(struct _nv *x, int value, int sz);
|
||||
|
||||
/* SFF-8472 Rev. 11.4 table 3.4: Connector values */
|
||||
/* SFF-8024 Rev. 4.1 Table 4-3: Connector Types */
|
||||
static struct _nv conn[] = {
|
||||
{ 0x00, "Unknown" },
|
||||
{ 0x01, "SC" },
|
||||
@@ -106,7 +106,8 @@ static struct _nv conn[] = {
|
||||
{ 0x20, "HSSDC II" },
|
||||
{ 0x21, "Copper pigtail" },
|
||||
{ 0x22, "RJ45" },
|
||||
{ 0x23, "No separate connector" }, /* SFF-8436 */
|
||||
{ 0x23, "No separable connector" },
|
||||
{ 0x24, "MXC 2x16" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
|
||||
@@ -202,10 +203,17 @@ static struct _nv eth_1040g[] = {
|
||||
};
|
||||
#define SFF_8636_EXT_COMPLIANCE 0x80
|
||||
|
||||
/* SFF-8024 Rev. 3.4 table 4.4: Extended Specification Compliance */
|
||||
/* SFF-8024 Rev. 4.2 table 4-4: Extended Specification Compliance */
|
||||
static struct _nv eth_extended_comp[] = {
|
||||
{ 0xFF, "Reserved" },
|
||||
{ 0x1A, "2 lambda DWDM 100G" },
|
||||
{ 0x21, "100G PAM4 BiDi" },
|
||||
{ 0x20, "100G SWDM4" },
|
||||
{ 0x1F, "40G SWDM4" },
|
||||
{ 0x1E, "2.5GBASE-T" },
|
||||
{ 0x1D, "5GBASE-T" },
|
||||
{ 0x1C, "10GBASE-T Short Reach" },
|
||||
{ 0x1B, "100G 1550nm WDM" },
|
||||
{ 0x1A, "100GE-DWDM2" },
|
||||
{ 0x19, "100G ACC or 25GAUI C2M ACC" },
|
||||
{ 0x18, "100G AOC or 25GAUI C2M AOC" },
|
||||
{ 0x17, "100G CLR4" },
|
||||
@@ -217,23 +225,24 @@ static struct _nv eth_extended_comp[] = {
|
||||
{ 0x11, "4 x 10GBASE-SR" },
|
||||
{ 0x10, "40GBASE-ER4" },
|
||||
{ 0x0F, "Reserved" },
|
||||
{ 0x0E, "Reserved" },
|
||||
{ 0x0D, "25GBASE-CR CA-N" },
|
||||
{ 0x0C, "25GBASE-CR CA-S" },
|
||||
{ 0x0B, "100GBASE-CR4 or 25GBASE-CR CA-L" },
|
||||
{ 0x0A, "Reserved" },
|
||||
{ 0x09, "100G CWDM4 MSA without FEC" },
|
||||
{ 0x08, "100G ACC (Active Copper Cable)" },
|
||||
{ 0x09, "Obsolete" },
|
||||
{ 0x08, "100G ACC (Active Copper Cable) or 25GAUI C2M ACC" },
|
||||
{ 0x07, "100G PSM4 Parallel SMF" },
|
||||
{ 0x06, "100G CWDM4 MSA with FEC" },
|
||||
{ 0x06, "100G CWDM4" },
|
||||
{ 0x05, "100GBASE-SR10" },
|
||||
{ 0x04, "100GBASE-ER4" },
|
||||
{ 0x03, "100GBASE-LR4" },
|
||||
{ 0x02, "100GBASE-SR4" },
|
||||
{ 0x01, "100G AOC (Active Optical Cable) or 25GAUI C2M ACC" },
|
||||
{ 0x04, "100GBASE-ER4 or 25GBASE-ER" },
|
||||
{ 0x03, "100GBASE-LR4 or 25GBASE-LR" },
|
||||
{ 0x02, "100GBASE-SR4 or 25GBASE-SR" },
|
||||
{ 0x01, "100G AOC (Active Optical Cable) or 25GAUI C2M AOC" },
|
||||
{ 0x00, "Unspecified" }
|
||||
};
|
||||
|
||||
/* SFF-8636 Rev. 2.5 table 6.3: Revision compliance */
|
||||
/* SFF-8636 Rev. 2.9 table 6.3: Revision compliance */
|
||||
static struct _nv rev_compl[] = {
|
||||
{ 0x1, "SFF-8436 rev <=4.8" },
|
||||
{ 0x2, "SFF-8436 rev <=4.8" },
|
||||
@@ -241,7 +250,8 @@ static struct _nv rev_compl[] = {
|
||||
{ 0x4, "SFF-8636 rev <=1.4" },
|
||||
{ 0x5, "SFF-8636 rev <=1.5" },
|
||||
{ 0x6, "SFF-8636 rev <=2.0" },
|
||||
{ 0x7, "SFF-8636 rev <=2.5" },
|
||||
{ 0x7, "SFF-8636 rev <=2.7" },
|
||||
{ 0x8, "SFF-8636 rev >=2.8" },
|
||||
{ 0x0, "Unspecified" }
|
||||
};
|
||||
|
||||
@@ -397,17 +407,20 @@ get_sfp_transceiver_class(struct i2c_info *ii, char *buf, size_t size)
|
||||
const char *tech_class;
|
||||
uint8_t code;
|
||||
|
||||
unsigned char qbuf[8];
|
||||
read_i2c(ii, SFF_8472_BASE, SFF_8472_TRANS_START, 8, (uint8_t *)qbuf);
|
||||
|
||||
/* Check 10G Ethernet/IB first */
|
||||
read_i2c(ii, SFF_8472_BASE, SFF_8472_TRANS_START, 1, &code);
|
||||
tech_class = find_zero_bit(eth_10g, code, 1);
|
||||
if (tech_class == NULL) {
|
||||
/* No match. Try Ethernet 1G */
|
||||
read_i2c(ii, SFF_8472_BASE, SFF_8472_TRANS_START + 3,
|
||||
1, (caddr_t)&code);
|
||||
tech_class = find_zero_bit(eth_compat, code, 1);
|
||||
/* Use extended compliance code if it's valid */
|
||||
read_i2c(ii, SFF_8472_BASE, SFF_8472_TRANS, 1, &code);
|
||||
if (code != 0)
|
||||
tech_class = find_value(eth_extended_comp, code);
|
||||
else {
|
||||
/* Next, check 10G Ethernet/IB CCs */
|
||||
read_i2c(ii, SFF_8472_BASE, SFF_8472_TRANS_START, 1, &code);
|
||||
tech_class = find_zero_bit(eth_10g, code, 1);
|
||||
if (tech_class == NULL) {
|
||||
/* No match. Try Ethernet 1G */
|
||||
read_i2c(ii, SFF_8472_BASE, SFF_8472_TRANS_START + 3,
|
||||
1, (caddr_t)&code);
|
||||
tech_class = find_zero_bit(eth_compat, code, 1);
|
||||
}
|
||||
}
|
||||
|
||||
if (tech_class == NULL)
|
||||
|
@@ -1536,6 +1536,7 @@ pfctl_rules(int dev, char *filename, int opts, int optimize,
|
||||
if (pfctl_trans(dev, t, DIOCXCOMMIT, osize))
|
||||
ERR("DIOCXCOMMIT");
|
||||
}
|
||||
free(path);
|
||||
return (0);
|
||||
|
||||
_error:
|
||||
@@ -1545,6 +1546,7 @@ _error:
|
||||
err(1, "DIOCXROLLBACK");
|
||||
exit(1);
|
||||
} else { /* sub ruleset */
|
||||
free(path);
|
||||
return (-1);
|
||||
}
|
||||
|
||||
|
@@ -1115,7 +1115,7 @@ skip_cmp_dst_addr(struct pf_rule *a, struct pf_rule *b)
|
||||
return (0);
|
||||
case PF_ADDR_DYNIFTL:
|
||||
if (strcmp(a->dst.addr.v.ifname, b->dst.addr.v.ifname) != 0 ||
|
||||
a->dst.addr.iflags != a->dst.addr.iflags ||
|
||||
a->dst.addr.iflags != b->dst.addr.iflags ||
|
||||
memcmp(&a->dst.addr.v.a.mask, &b->dst.addr.v.a.mask,
|
||||
sizeof(a->dst.addr.v.a.mask)))
|
||||
return (1);
|
||||
@@ -1187,7 +1187,7 @@ skip_cmp_src_addr(struct pf_rule *a, struct pf_rule *b)
|
||||
return (0);
|
||||
case PF_ADDR_DYNIFTL:
|
||||
if (strcmp(a->src.addr.v.ifname, b->src.addr.v.ifname) != 0 ||
|
||||
a->src.addr.iflags != a->src.addr.iflags ||
|
||||
a->src.addr.iflags != b->src.addr.iflags ||
|
||||
memcmp(&a->src.addr.v.a.mask, &b->src.addr.v.a.mask,
|
||||
sizeof(a->src.addr.v.a.mask)))
|
||||
return (1);
|
||||
|
Reference in New Issue
Block a user