netinet6: trim overly long lines in GET_PKTOPT_VAR(), fit into 80 chars
This commit is contained in:
parent
3ba34b07a4
commit
2e0e273927
@ -2571,33 +2571,33 @@ ip6_pcbopt(int optname, u_char *buf, int len, struct ip6_pktopts **pktopt,
|
||||
return (ret);
|
||||
}
|
||||
|
||||
#define GET_PKTOPT_VAR(field, lenexpr) do { \
|
||||
if (pktopt && pktopt->field) { \
|
||||
INP_RUNLOCK(inp); \
|
||||
optdata = malloc(sopt->sopt_valsize, M_TEMP, M_WAITOK); \
|
||||
malloc_optdata = true; \
|
||||
INP_RLOCK(inp); \
|
||||
if (inp->inp_flags & INP_DROPPED) { \
|
||||
INP_RUNLOCK(inp); \
|
||||
free(optdata, M_TEMP); \
|
||||
return (ECONNRESET); \
|
||||
} \
|
||||
pktopt = inp->in6p_outputopts; \
|
||||
if (pktopt && pktopt->field) { \
|
||||
optdatalen = min(lenexpr, sopt->sopt_valsize); \
|
||||
bcopy(pktopt->field, optdata, optdatalen); \
|
||||
} else { \
|
||||
free(optdata, M_TEMP); \
|
||||
optdata = NULL; \
|
||||
malloc_optdata = false; \
|
||||
} \
|
||||
} \
|
||||
#define GET_PKTOPT_VAR(field, lenexpr) do { \
|
||||
if (pktopt && pktopt->field) { \
|
||||
INP_RUNLOCK(inp); \
|
||||
optdata = malloc(sopt->sopt_valsize, M_TEMP, M_WAITOK); \
|
||||
malloc_optdata = true; \
|
||||
INP_RLOCK(inp); \
|
||||
if (inp->inp_flags & INP_DROPPED) { \
|
||||
INP_RUNLOCK(inp); \
|
||||
free(optdata, M_TEMP); \
|
||||
return (ECONNRESET); \
|
||||
} \
|
||||
pktopt = inp->in6p_outputopts; \
|
||||
if (pktopt && pktopt->field) { \
|
||||
optdatalen = min(lenexpr, sopt->sopt_valsize); \
|
||||
bcopy(pktopt->field, optdata, optdatalen); \
|
||||
} else { \
|
||||
free(optdata, M_TEMP); \
|
||||
optdata = NULL; \
|
||||
malloc_optdata = false; \
|
||||
} \
|
||||
} \
|
||||
} while(0)
|
||||
|
||||
#define GET_PKTOPT_EXT_HDR(field) GET_PKTOPT_VAR(field, \
|
||||
#define GET_PKTOPT_EXT_HDR(field) GET_PKTOPT_VAR(field, \
|
||||
(((struct ip6_ext *)pktopt->field)->ip6e_len + 1) << 3)
|
||||
|
||||
#define GET_PKTOPT_SOCKADDR(field) GET_PKTOPT_VAR(field, \
|
||||
#define GET_PKTOPT_SOCKADDR(field) GET_PKTOPT_VAR(field, \
|
||||
pktopt->field->sa_len)
|
||||
|
||||
static int
|
||||
|
Loading…
Reference in New Issue
Block a user