summaryrefslogtreecommitdiffstats
path: root/sys/netinet/ip_input.c
diff options
context:
space:
mode:
authorpluknet <pluknet@FreeBSD.org>2013-02-20 15:44:40 +0000
committerpluknet <pluknet@FreeBSD.org>2013-02-20 15:44:40 +0000
commit5be772ca1074c8bc1ed5c72a2a840f704b127ade (patch)
tree7773a52ecada4130f7939926a04c4c5ce89d79a2 /sys/netinet/ip_input.c
parent327967222614ab8336aa339a369eaed8d05b377e (diff)
downloadFreeBSD-src-5be772ca1074c8bc1ed5c72a2a840f704b127ade.zip
FreeBSD-src-5be772ca1074c8bc1ed5c72a2a840f704b127ade.tar.gz
ip_savecontrol() style fixes. No functional changes.
- fix indentation - put the operator at the end of the line for long statements - remove spaces between the type and the variable in a cast - remove excessive parentheses Tested by: md5
Diffstat (limited to 'sys/netinet/ip_input.c')
-rw-r--r--sys/netinet/ip_input.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c
index 0e559a6..555b5d0 100644
--- a/sys/netinet/ip_input.c
+++ b/sys/netinet/ip_input.c
@@ -1592,8 +1592,8 @@ ip_savecontrol(struct inpcb *inp, struct mbuf **mp, struct ip *ip,
bintime(&bt);
if (inp->inp_socket->so_options & SO_BINTIME) {
- *mp = sbcreatecontrol((caddr_t) &bt, sizeof(bt),
- SCM_BINTIME, SOL_SOCKET);
+ *mp = sbcreatecontrol((caddr_t)&bt, sizeof(bt),
+ SCM_BINTIME, SOL_SOCKET);
if (*mp)
mp = &(*mp)->m_next;
}
@@ -1601,20 +1601,20 @@ ip_savecontrol(struct inpcb *inp, struct mbuf **mp, struct ip *ip,
struct timeval tv;
bintime2timeval(&bt, &tv);
- *mp = sbcreatecontrol((caddr_t) &tv, sizeof(tv),
- SCM_TIMESTAMP, SOL_SOCKET);
+ *mp = sbcreatecontrol((caddr_t)&tv, sizeof(tv),
+ SCM_TIMESTAMP, SOL_SOCKET);
if (*mp)
mp = &(*mp)->m_next;
}
}
if (inp->inp_flags & INP_RECVDSTADDR) {
- *mp = sbcreatecontrol((caddr_t) &ip->ip_dst,
+ *mp = sbcreatecontrol((caddr_t)&ip->ip_dst,
sizeof(struct in_addr), IP_RECVDSTADDR, IPPROTO_IP);
if (*mp)
mp = &(*mp)->m_next;
}
if (inp->inp_flags & INP_RECVTTL) {
- *mp = sbcreatecontrol((caddr_t) &ip->ip_ttl,
+ *mp = sbcreatecontrol((caddr_t)&ip->ip_ttl,
sizeof(u_char), IP_RECVTTL, IPPROTO_IP);
if (*mp)
mp = &(*mp)->m_next;
@@ -1626,14 +1626,14 @@ ip_savecontrol(struct inpcb *inp, struct mbuf **mp, struct ip *ip,
*/
/* options were tossed already */
if (inp->inp_flags & INP_RECVOPTS) {
- *mp = sbcreatecontrol((caddr_t) opts_deleted_above,
+ *mp = sbcreatecontrol((caddr_t)opts_deleted_above,
sizeof(struct in_addr), IP_RECVOPTS, IPPROTO_IP);
if (*mp)
mp = &(*mp)->m_next;
}
/* ip_srcroute doesn't do what we want here, need to fix */
if (inp->inp_flags & INP_RECVRETOPTS) {
- *mp = sbcreatecontrol((caddr_t) ip_srcroute(m),
+ *mp = sbcreatecontrol((caddr_t)ip_srcroute(m),
sizeof(struct in_addr), IP_RECVRETOPTS, IPPROTO_IP);
if (*mp)
mp = &(*mp)->m_next;
@@ -1648,32 +1648,32 @@ ip_savecontrol(struct inpcb *inp, struct mbuf **mp, struct ip *ip,
struct sockaddr_dl *sdp;
struct sockaddr_dl *sdl2 = &sdlbuf.sdl;
- if (((ifp = m->m_pkthdr.rcvif))
- && ( ifp->if_index && (ifp->if_index <= V_if_index))) {
+ if ((ifp = m->m_pkthdr.rcvif) &&
+ ifp->if_index && ifp->if_index <= V_if_index) {
sdp = (struct sockaddr_dl *)ifp->if_addr->ifa_addr;
/*
* Change our mind and don't try copy.
*/
- if ((sdp->sdl_family != AF_LINK)
- || (sdp->sdl_len > sizeof(sdlbuf))) {
+ if (sdp->sdl_family != AF_LINK ||
+ sdp->sdl_len > sizeof(sdlbuf)) {
goto makedummy;
}
bcopy(sdp, sdl2, sdp->sdl_len);
} else {
makedummy:
- sdl2->sdl_len
- = offsetof(struct sockaddr_dl, sdl_data[0]);
+ sdl2->sdl_len =
+ offsetof(struct sockaddr_dl, sdl_data[0]);
sdl2->sdl_family = AF_LINK;
sdl2->sdl_index = 0;
sdl2->sdl_nlen = sdl2->sdl_alen = sdl2->sdl_slen = 0;
}
- *mp = sbcreatecontrol((caddr_t) sdl2, sdl2->sdl_len,
- IP_RECVIF, IPPROTO_IP);
+ *mp = sbcreatecontrol((caddr_t)sdl2, sdl2->sdl_len,
+ IP_RECVIF, IPPROTO_IP);
if (*mp)
mp = &(*mp)->m_next;
}
if (inp->inp_flags & INP_RECVTOS) {
- *mp = sbcreatecontrol((caddr_t) &ip->ip_tos,
+ *mp = sbcreatecontrol((caddr_t)&ip->ip_tos,
sizeof(u_char), IP_RECVTOS, IPPROTO_IP);
if (*mp)
mp = &(*mp)->m_next;
OpenPOWER on IntegriCloud