Deleted Added
full compact
rtsock.c (266860) rtsock.c (269243)
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 266860 2014-05-29 21:03:49Z asomers $
30 * $FreeBSD: head/sys/net/rtsock.c 269243 2014-07-29 15:01:29Z glebius $
31 */
32#include "opt_compat.h"
33#include "opt_mpath.h"
34#include "opt_inet.h"
35#include "opt_inet6.h"
36
37#include <sys/param.h>
38#include <sys/jail.h>

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

1284 info.rti_info[RTAX_IFP] = ifp->if_addr->ifa_addr;
1285 info.rti_info[RTAX_NETMASK] = rtsock_fix_netmask(
1286 info.rti_info[RTAX_IFP], ifa->ifa_netmask, &ss);
1287 info.rti_info[RTAX_BRD] = ifa->ifa_dstaddr;
1288 if ((m = rtsock_msg_mbuf(ncmd, &info)) == NULL)
1289 return (ENOBUFS);
1290 ifam = mtod(m, struct ifa_msghdr *);
1291 ifam->ifam_index = ifp->if_index;
31 */
32#include "opt_compat.h"
33#include "opt_mpath.h"
34#include "opt_inet.h"
35#include "opt_inet6.h"
36
37#include <sys/param.h>
38#include <sys/jail.h>

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

1284 info.rti_info[RTAX_IFP] = ifp->if_addr->ifa_addr;
1285 info.rti_info[RTAX_NETMASK] = rtsock_fix_netmask(
1286 info.rti_info[RTAX_IFP], ifa->ifa_netmask, &ss);
1287 info.rti_info[RTAX_BRD] = ifa->ifa_dstaddr;
1288 if ((m = rtsock_msg_mbuf(ncmd, &info)) == NULL)
1289 return (ENOBUFS);
1290 ifam = mtod(m, struct ifa_msghdr *);
1291 ifam->ifam_index = ifp->if_index;
1292 ifam->ifam_metric = ifa->ifa_metric;
1292 ifam->ifam_metric = ifa->ifa_ifp->if_metric;
1293 ifam->ifam_flags = ifa->ifa_flags;
1294 ifam->ifam_addrs = info.rti_addrs;
1295
1296 if (fibnum != RT_ALL_FIBS) {
1297 M_SETFIB(m, fibnum);
1298 m->m_flags |= RTS_FILTER_FIB;
1299 }
1300

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

1633 ifam32 = (struct ifa_msghdrl32 *)ifam;
1634 ifam32->ifam_addrs = info->rti_addrs;
1635 ifam32->ifam_flags = ifa->ifa_flags;
1636 ifam32->ifam_index = ifa->ifa_ifp->if_index;
1637 ifam32->_ifam_spare1 = 0;
1638 ifam32->ifam_len = sizeof(*ifam32);
1639 ifam32->ifam_data_off =
1640 offsetof(struct ifa_msghdrl32, ifam_data);
1293 ifam->ifam_flags = ifa->ifa_flags;
1294 ifam->ifam_addrs = info.rti_addrs;
1295
1296 if (fibnum != RT_ALL_FIBS) {
1297 M_SETFIB(m, fibnum);
1298 m->m_flags |= RTS_FILTER_FIB;
1299 }
1300

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

1633 ifam32 = (struct ifa_msghdrl32 *)ifam;
1634 ifam32->ifam_addrs = info->rti_addrs;
1635 ifam32->ifam_flags = ifa->ifa_flags;
1636 ifam32->ifam_index = ifa->ifa_ifp->if_index;
1637 ifam32->_ifam_spare1 = 0;
1638 ifam32->ifam_len = sizeof(*ifam32);
1639 ifam32->ifam_data_off =
1640 offsetof(struct ifa_msghdrl32, ifam_data);
1641 ifam32->ifam_metric = ifa->ifa_metric;
1641 ifam32->ifam_metric = ifa->ifa_ifp->if_metric;
1642 ifd = &ifam32->ifam_data;
1643 } else
1644#endif
1645 {
1646 ifam->ifam_addrs = info->rti_addrs;
1647 ifam->ifam_flags = ifa->ifa_flags;
1648 ifam->ifam_index = ifa->ifa_ifp->if_index;
1649 ifam->_ifam_spare1 = 0;
1650 ifam->ifam_len = sizeof(*ifam);
1651 ifam->ifam_data_off = offsetof(struct ifa_msghdrl, ifam_data);
1642 ifd = &ifam32->ifam_data;
1643 } else
1644#endif
1645 {
1646 ifam->ifam_addrs = info->rti_addrs;
1647 ifam->ifam_flags = ifa->ifa_flags;
1648 ifam->ifam_index = ifa->ifa_ifp->if_index;
1649 ifam->_ifam_spare1 = 0;
1650 ifam->ifam_len = sizeof(*ifam);
1651 ifam->ifam_data_off = offsetof(struct ifa_msghdrl, ifam_data);
1652 ifam->ifam_metric = ifa->ifa_metric;
1652 ifam->ifam_metric = ifa->ifa_ifp->if_metric;
1653 ifd = &ifam->ifam_data;
1654 }
1655
1656 bzero(ifd, sizeof(*ifd));
1657 ifd->ifi_datalen = sizeof(struct if_data);
1658 ifd->ifi_ipackets = counter_u64_fetch(ifa->ifa_ipackets);
1659 ifd->ifi_opackets = counter_u64_fetch(ifa->ifa_opackets);
1660 ifd->ifi_ibytes = counter_u64_fetch(ifa->ifa_ibytes);

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

1672 struct walkarg *w, int len)
1673{
1674 struct ifa_msghdr *ifam;
1675
1676 ifam = (struct ifa_msghdr *)w->w_tmem;
1677 ifam->ifam_addrs = info->rti_addrs;
1678 ifam->ifam_flags = ifa->ifa_flags;
1679 ifam->ifam_index = ifa->ifa_ifp->if_index;
1653 ifd = &ifam->ifam_data;
1654 }
1655
1656 bzero(ifd, sizeof(*ifd));
1657 ifd->ifi_datalen = sizeof(struct if_data);
1658 ifd->ifi_ipackets = counter_u64_fetch(ifa->ifa_ipackets);
1659 ifd->ifi_opackets = counter_u64_fetch(ifa->ifa_opackets);
1660 ifd->ifi_ibytes = counter_u64_fetch(ifa->ifa_ibytes);

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

1672 struct walkarg *w, int len)
1673{
1674 struct ifa_msghdr *ifam;
1675
1676 ifam = (struct ifa_msghdr *)w->w_tmem;
1677 ifam->ifam_addrs = info->rti_addrs;
1678 ifam->ifam_flags = ifa->ifa_flags;
1679 ifam->ifam_index = ifa->ifa_ifp->if_index;
1680 ifam->ifam_metric = ifa->ifa_metric;
1680 ifam->ifam_metric = ifa->ifa_ifp->if_metric;
1681
1682 return (SYSCTL_OUT(w->w_req, w->w_tmem, len));
1683}
1684
1685static int
1686sysctl_iflist(int af, struct walkarg *w)
1687{
1688 struct ifnet *ifp;

--- 237 unchanged lines hidden ---
1681
1682 return (SYSCTL_OUT(w->w_req, w->w_tmem, len));
1683}
1684
1685static int
1686sysctl_iflist(int af, struct walkarg *w)
1687{
1688 struct ifnet *ifp;

--- 237 unchanged lines hidden ---