Deleted Added
full compact
rtsock.c (191548) rtsock.c (191816)
1/*-
2 * Copyright (c) 1988, 1991, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 13 unchanged lines hidden (view full) ---

22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 *
29 * @(#)rtsock.c 8.7 (Berkeley) 10/12/95
1/*-
2 * Copyright (c) 1988, 1991, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 13 unchanged lines hidden (view full) ---

22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 *
29 * @(#)rtsock.c 8.7 (Berkeley) 10/12/95
30 * $FreeBSD: head/sys/net/rtsock.c 191548 2009-04-26 22:06:42Z zec $
30 * $FreeBSD: head/sys/net/rtsock.c 191816 2009-05-05 10:56:12Z zec $
31 */
32#include "opt_sctp.h"
33#include "opt_mpath.h"
34#include "opt_route.h"
35#include "opt_inet.h"
36#include "opt_inet6.h"
37
38#include <sys/param.h>

--- 1162 unchanged lines hidden (view full) ---

1201 m = rt_makeifannouncemsg(ifp, RTM_IFANNOUNCE, what, &info);
1202 if (m != NULL)
1203 rt_dispatch(m, NULL);
1204}
1205
1206static void
1207rt_dispatch(struct mbuf *m, const struct sockaddr *sa)
1208{
31 */
32#include "opt_sctp.h"
33#include "opt_mpath.h"
34#include "opt_route.h"
35#include "opt_inet.h"
36#include "opt_inet6.h"
37
38#include <sys/param.h>

--- 1162 unchanged lines hidden (view full) ---

1201 m = rt_makeifannouncemsg(ifp, RTM_IFANNOUNCE, what, &info);
1202 if (m != NULL)
1203 rt_dispatch(m, NULL);
1204}
1205
1206static void
1207rt_dispatch(struct mbuf *m, const struct sockaddr *sa)
1208{
1209 INIT_VNET_NET(curvnet);
1209 struct m_tag *tag;
1210
1211 /*
1212 * Preserve the family from the sockaddr, if any, in an m_tag for
1213 * use when injecting the mbuf into the routing socket buffer from
1214 * the netisr.
1215 */
1216 if (sa != NULL) {
1217 tag = m_tag_get(PACKET_TAG_RTSOCKFAM, sizeof(unsigned short),
1218 M_NOWAIT);
1219 if (tag == NULL) {
1220 m_freem(m);
1221 return;
1222 }
1223 *(unsigned short *)(tag + 1) = sa->sa_family;
1224 m_tag_prepend(m, tag);
1225 }
1210 struct m_tag *tag;
1211
1212 /*
1213 * Preserve the family from the sockaddr, if any, in an m_tag for
1214 * use when injecting the mbuf into the routing socket buffer from
1215 * the netisr.
1216 */
1217 if (sa != NULL) {
1218 tag = m_tag_get(PACKET_TAG_RTSOCKFAM, sizeof(unsigned short),
1219 M_NOWAIT);
1220 if (tag == NULL) {
1221 m_freem(m);
1222 return;
1223 }
1224 *(unsigned short *)(tag + 1) = sa->sa_family;
1225 m_tag_prepend(m, tag);
1226 }
1227#ifdef VIMAGE
1228 if (V_loif)
1229 m->m_pkthdr.rcvif = V_loif;
1230 else {
1231 m_freem(m);
1232 return;
1233 }
1234#endif
1226 netisr_queue(NETISR_ROUTE, m); /* mbuf is free'd on failure. */
1227}
1228
1229/*
1230 * This is used in dumping the kernel table via sysctl().
1231 */
1232static int
1233sysctl_dumpentry(struct radix_node *rn, void *vw)

--- 257 unchanged lines hidden ---
1235 netisr_queue(NETISR_ROUTE, m); /* mbuf is free'd on failure. */
1236}
1237
1238/*
1239 * This is used in dumping the kernel table via sysctl().
1240 */
1241static int
1242sysctl_dumpentry(struct radix_node *rn, void *vw)

--- 257 unchanged lines hidden ---