ip6_mroute.c (160981) | ip6_mroute.c (165118) |
---|---|
1/* $FreeBSD: head/sys/netinet6/ip6_mroute.c 160981 2006-08-04 21:27:40Z brooks $ */ | 1/* $FreeBSD: head/sys/netinet6/ip6_mroute.c 165118 2006-12-12 12:17:58Z bz $ */ |
2/* $KAME: ip6_mroute.c,v 1.58 2001/12/18 02:36:31 itojun Exp $ */ 3 4/*- 5 * Copyright (C) 1998 WIDE Project. 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without 9 * modification, are permitted provided that the following conditions --- 710 unchanged lines hidden (view full) --- 720add_m6fc(mfccp) 721 struct mf6cctl *mfccp; 722{ 723 struct mf6c *rt; 724 u_long hash; 725 struct rtdetq *rte; 726 u_short nstl; 727 int s; | 2/* $KAME: ip6_mroute.c,v 1.58 2001/12/18 02:36:31 itojun Exp $ */ 3 4/*- 5 * Copyright (C) 1998 WIDE Project. 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without 9 * modification, are permitted provided that the following conditions --- 710 unchanged lines hidden (view full) --- 720add_m6fc(mfccp) 721 struct mf6cctl *mfccp; 722{ 723 struct mf6c *rt; 724 u_long hash; 725 struct rtdetq *rte; 726 u_short nstl; 727 int s; |
728 char ip6bufo[INET6_ADDRSTRLEN], ip6bufg[INET6_ADDRSTRLEN]; |
|
728 729 MF6CFIND(mfccp->mf6cc_origin.sin6_addr, 730 mfccp->mf6cc_mcastgrp.sin6_addr, rt); 731 732 /* If an entry already exists, just update the fields */ 733 if (rt) { 734#ifdef MRT6DEBUG | 729 730 MF6CFIND(mfccp->mf6cc_origin.sin6_addr, 731 mfccp->mf6cc_mcastgrp.sin6_addr, rt); 732 733 /* If an entry already exists, just update the fields */ 734 if (rt) { 735#ifdef MRT6DEBUG |
735 if (mrt6debug & DEBUG_MFC) 736 log(LOG_DEBUG, 737 "add_m6fc no upcall h %d o %s g %s p %x\n", 738 ip6_sprintf(&mfccp->mf6cc_origin.sin6_addr), 739 ip6_sprintf(&mfccp->mf6cc_mcastgrp.sin6_addr), 740 mfccp->mf6cc_parent); | 736 if (mrt6debug & DEBUG_MFC) { 737 log(LOG_DEBUG, 738 "add_m6fc no upcall h %d o %s g %s p %x\n", 739 ip6_sprintf(ip6bufo, &mfccp->mf6cc_origin.sin6_addr), 740 ip6_sprintf(ip6bufg, &mfccp->mf6cc_mcastgrp.sin6_addr), 741 mfccp->mf6cc_parent); 742 } |
741#endif 742 743 s = splnet(); 744 rt->mf6c_parent = mfccp->mf6cc_parent; 745 rt->mf6c_ifset = mfccp->mf6cc_ifset; 746 splx(s); 747 return (0); 748 } --- 10 unchanged lines hidden (view full) --- 759 IN6_ARE_ADDR_EQUAL(&rt->mf6c_mcastgrp.sin6_addr, 760 &mfccp->mf6cc_mcastgrp.sin6_addr) && 761 (rt->mf6c_stall != NULL)) { 762 763 if (nstl++) 764 log(LOG_ERR, 765 "add_m6fc: %s o %s g %s p %x dbx %p\n", 766 "multiple kernel entries", | 743#endif 744 745 s = splnet(); 746 rt->mf6c_parent = mfccp->mf6cc_parent; 747 rt->mf6c_ifset = mfccp->mf6cc_ifset; 748 splx(s); 749 return (0); 750 } --- 10 unchanged lines hidden (view full) --- 761 IN6_ARE_ADDR_EQUAL(&rt->mf6c_mcastgrp.sin6_addr, 762 &mfccp->mf6cc_mcastgrp.sin6_addr) && 763 (rt->mf6c_stall != NULL)) { 764 765 if (nstl++) 766 log(LOG_ERR, 767 "add_m6fc: %s o %s g %s p %x dbx %p\n", 768 "multiple kernel entries", |
767 ip6_sprintf(&mfccp->mf6cc_origin.sin6_addr), 768 ip6_sprintf(&mfccp->mf6cc_mcastgrp.sin6_addr), | 769 ip6_sprintf(ip6bufo, 770 &mfccp->mf6cc_origin.sin6_addr), 771 ip6_sprintf(ip6bufg, 772 &mfccp->mf6cc_mcastgrp.sin6_addr), |
769 mfccp->mf6cc_parent, rt->mf6c_stall); 770 771#ifdef MRT6DEBUG 772 if (mrt6debug & DEBUG_MFC) 773 log(LOG_DEBUG, 774 "add_m6fc o %s g %s p %x dbg %x\n", | 773 mfccp->mf6cc_parent, rt->mf6c_stall); 774 775#ifdef MRT6DEBUG 776 if (mrt6debug & DEBUG_MFC) 777 log(LOG_DEBUG, 778 "add_m6fc o %s g %s p %x dbg %x\n", |
775 ip6_sprintf(&mfccp->mf6cc_origin.sin6_addr), 776 ip6_sprintf(&mfccp->mf6cc_mcastgrp.sin6_addr), | 779 ip6_sprintf(ip6bufo, 780 &mfccp->mf6cc_origin.sin6_addr), 781 ip6_sprintf(ip6bufg, 782 &mfccp->mf6cc_mcastgrp.sin6_addr), |
777 mfccp->mf6cc_parent, rt->mf6c_stall); 778#endif 779 780 rt->mf6c_origin = mfccp->mf6cc_origin; 781 rt->mf6c_mcastgrp = mfccp->mf6cc_mcastgrp; 782 rt->mf6c_parent = mfccp->mf6cc_parent; 783 rt->mf6c_ifset = mfccp->mf6cc_ifset; 784 /* initialize pkt counters per src-grp */ --- 20 unchanged lines hidden (view full) --- 805 } 806 807 /* 808 * It is possible that an entry is being inserted without an upcall 809 */ 810 if (nstl == 0) { 811#ifdef MRT6DEBUG 812 if (mrt6debug & DEBUG_MFC) | 783 mfccp->mf6cc_parent, rt->mf6c_stall); 784#endif 785 786 rt->mf6c_origin = mfccp->mf6cc_origin; 787 rt->mf6c_mcastgrp = mfccp->mf6cc_mcastgrp; 788 rt->mf6c_parent = mfccp->mf6cc_parent; 789 rt->mf6c_ifset = mfccp->mf6cc_ifset; 790 /* initialize pkt counters per src-grp */ --- 20 unchanged lines hidden (view full) --- 811 } 812 813 /* 814 * It is possible that an entry is being inserted without an upcall 815 */ 816 if (nstl == 0) { 817#ifdef MRT6DEBUG 818 if (mrt6debug & DEBUG_MFC) |
813 log(LOG_DEBUG, 814 "add_mfc no upcall h %d o %s g %s p %x\n", 815 hash, 816 ip6_sprintf(&mfccp->mf6cc_origin.sin6_addr), 817 ip6_sprintf(&mfccp->mf6cc_mcastgrp.sin6_addr), 818 mfccp->mf6cc_parent); | 819 log(LOG_DEBUG, 820 "add_mfc no upcall h %d o %s g %s p %x\n", 821 hash, 822 ip6_sprintf(ip6bufo, &mfccp->mf6cc_origin.sin6_addr), 823 ip6_sprintf(ip6bufg, &mfccp->mf6cc_mcastgrp.sin6_addr), 824 mfccp->mf6cc_parent); |
819#endif 820 821 for (rt = mf6ctable[hash]; rt; rt = rt->mf6c_next) { 822 823 if (IN6_ARE_ADDR_EQUAL(&rt->mf6c_origin.sin6_addr, 824 &mfccp->mf6cc_origin.sin6_addr)&& 825 IN6_ARE_ADDR_EQUAL(&rt->mf6c_mcastgrp.sin6_addr, 826 &mfccp->mf6cc_mcastgrp.sin6_addr)) { --- 83 unchanged lines hidden (view full) --- 910 u_long hash; 911 int s; 912 913 origin = mfccp->mf6cc_origin; 914 mcastgrp = mfccp->mf6cc_mcastgrp; 915 hash = MF6CHASH(origin.sin6_addr, mcastgrp.sin6_addr); 916 917#ifdef MRT6DEBUG | 825#endif 826 827 for (rt = mf6ctable[hash]; rt; rt = rt->mf6c_next) { 828 829 if (IN6_ARE_ADDR_EQUAL(&rt->mf6c_origin.sin6_addr, 830 &mfccp->mf6cc_origin.sin6_addr)&& 831 IN6_ARE_ADDR_EQUAL(&rt->mf6c_mcastgrp.sin6_addr, 832 &mfccp->mf6cc_mcastgrp.sin6_addr)) { --- 83 unchanged lines hidden (view full) --- 916 u_long hash; 917 int s; 918 919 origin = mfccp->mf6cc_origin; 920 mcastgrp = mfccp->mf6cc_mcastgrp; 921 hash = MF6CHASH(origin.sin6_addr, mcastgrp.sin6_addr); 922 923#ifdef MRT6DEBUG |
918 if (mrt6debug & DEBUG_MFC) | 924 if (mrt6debug & DEBUG_MFC) { 925 char ip6bufo[INET6_ADDRSTRLEN], ip6bufg[INET6_ADDRSTRLEN]; |
919 log(LOG_DEBUG,"del_m6fc orig %s mcastgrp %s\n", | 926 log(LOG_DEBUG,"del_m6fc orig %s mcastgrp %s\n", |
920 ip6_sprintf(&origin.sin6_addr), 921 ip6_sprintf(&mcastgrp.sin6_addr)); | 927 ip6_sprintf(ip6bufo, &origin.sin6_addr), 928 ip6_sprintf(ip6bufg, &mcastgrp.sin6_addr)); 929 } |
922#endif 923 924 s = splnet(); 925 926 nptr = &mf6ctable[hash]; 927 while ((rt = *nptr) != NULL) { 928 if (IN6_ARE_ADDR_EQUAL(&origin.sin6_addr, 929 &rt->mf6c_origin.sin6_addr) && --- 60 unchanged lines hidden (view full) --- 990 struct ifnet *ifp; 991 struct mbuf *m; 992{ 993 struct mf6c *rt; 994 struct mif6 *mifp; 995 struct mbuf *mm; 996 int s; 997 mifi_t mifi; | 930#endif 931 932 s = splnet(); 933 934 nptr = &mf6ctable[hash]; 935 while ((rt = *nptr) != NULL) { 936 if (IN6_ARE_ADDR_EQUAL(&origin.sin6_addr, 937 &rt->mf6c_origin.sin6_addr) && --- 60 unchanged lines hidden (view full) --- 998 struct ifnet *ifp; 999 struct mbuf *m; 1000{ 1001 struct mf6c *rt; 1002 struct mif6 *mifp; 1003 struct mbuf *mm; 1004 int s; 1005 mifi_t mifi; |
1006 char ip6bufs[INET6_ADDRSTRLEN], ip6bufd[INET6_ADDRSTRLEN]; |
|
998 999#ifdef MRT6DEBUG 1000 if (mrt6debug & DEBUG_FORWARD) 1001 log(LOG_DEBUG, "ip6_mforward: src %s, dst %s, ifindex %d\n", | 1007 1008#ifdef MRT6DEBUG 1009 if (mrt6debug & DEBUG_FORWARD) 1010 log(LOG_DEBUG, "ip6_mforward: src %s, dst %s, ifindex %d\n", |
1002 ip6_sprintf(&ip6->ip6_src), ip6_sprintf(&ip6->ip6_dst), | 1011 ip6_sprintf(ip6bufs, &ip6->ip6_src), 1012 ip6_sprintf(ip6bufd, &ip6->ip6_dst), |
1003 ifp->if_index); 1004#endif 1005 1006 /* 1007 * Don't forward a packet with Hop limit of zero or one, 1008 * or a packet destined to a local-only group. 1009 */ 1010 if (ip6->ip6_hlim <= 1 || IN6_IS_ADDR_MC_INTFACELOCAL(&ip6->ip6_dst) || --- 10 unchanged lines hidden (view full) --- 1021 */ 1022 if (IN6_IS_ADDR_UNSPECIFIED(&ip6->ip6_src)) { 1023 ip6stat.ip6s_cantforward++; 1024 if (ip6_log_time + ip6_log_interval < time_second) { 1025 ip6_log_time = time_second; 1026 log(LOG_DEBUG, 1027 "cannot forward " 1028 "from %s to %s nxt %d received on %s\n", | 1013 ifp->if_index); 1014#endif 1015 1016 /* 1017 * Don't forward a packet with Hop limit of zero or one, 1018 * or a packet destined to a local-only group. 1019 */ 1020 if (ip6->ip6_hlim <= 1 || IN6_IS_ADDR_MC_INTFACELOCAL(&ip6->ip6_dst) || --- 10 unchanged lines hidden (view full) --- 1031 */ 1032 if (IN6_IS_ADDR_UNSPECIFIED(&ip6->ip6_src)) { 1033 ip6stat.ip6s_cantforward++; 1034 if (ip6_log_time + ip6_log_interval < time_second) { 1035 ip6_log_time = time_second; 1036 log(LOG_DEBUG, 1037 "cannot forward " 1038 "from %s to %s nxt %d received on %s\n", |
1029 ip6_sprintf(&ip6->ip6_src), 1030 ip6_sprintf(&ip6->ip6_dst), | 1039 ip6_sprintf(ip6bufs, &ip6->ip6_src), 1040 ip6_sprintf(ip6bufd, &ip6->ip6_dst), |
1031 ip6->ip6_nxt, 1032 if_name(m->m_pkthdr.rcvif)); 1033 } 1034 return (0); 1035 } 1036 1037 /* 1038 * Determine forwarding mifs from the forwarding cache table --- 21 unchanged lines hidden (view full) --- 1060 1061 GET_TIME(tp); 1062#endif /* UPCALL_TIMING */ 1063 1064 mrt6stat.mrt6s_no_route++; 1065#ifdef MRT6DEBUG 1066 if (mrt6debug & (DEBUG_FORWARD | DEBUG_MFC)) 1067 log(LOG_DEBUG, "ip6_mforward: no rte s %s g %s\n", | 1041 ip6->ip6_nxt, 1042 if_name(m->m_pkthdr.rcvif)); 1043 } 1044 return (0); 1045 } 1046 1047 /* 1048 * Determine forwarding mifs from the forwarding cache table --- 21 unchanged lines hidden (view full) --- 1070 1071 GET_TIME(tp); 1072#endif /* UPCALL_TIMING */ 1073 1074 mrt6stat.mrt6s_no_route++; 1075#ifdef MRT6DEBUG 1076 if (mrt6debug & (DEBUG_FORWARD | DEBUG_MFC)) 1077 log(LOG_DEBUG, "ip6_mforward: no rte s %s g %s\n", |
1068 ip6_sprintf(&ip6->ip6_src), 1069 ip6_sprintf(&ip6->ip6_dst)); | 1078 ip6_sprintf(ip6bufs, &ip6->ip6_src), 1079 ip6_sprintf(ip6bufd, &ip6->ip6_dst)); |
1070#endif 1071 1072 /* 1073 * Allocate mbufs early so that we don't do extra work if we 1074 * are just going to fail anyway. 1075 */ 1076 rte = (struct rtdetq *)malloc(sizeof(*rte), M_MRTABLE6, 1077 M_NOWAIT); --- 192 unchanged lines hidden (view full) --- 1270 * Skip real cache entries 1271 * Make sure it wasn't marked to not expire (shouldn't happen) 1272 * If it expires now 1273 */ 1274 if (rte != NULL && 1275 mfc->mf6c_expire != 0 && 1276 --mfc->mf6c_expire == 0) { 1277#ifdef MRT6DEBUG | 1080#endif 1081 1082 /* 1083 * Allocate mbufs early so that we don't do extra work if we 1084 * are just going to fail anyway. 1085 */ 1086 rte = (struct rtdetq *)malloc(sizeof(*rte), M_MRTABLE6, 1087 M_NOWAIT); --- 192 unchanged lines hidden (view full) --- 1280 * Skip real cache entries 1281 * Make sure it wasn't marked to not expire (shouldn't happen) 1282 * If it expires now 1283 */ 1284 if (rte != NULL && 1285 mfc->mf6c_expire != 0 && 1286 --mfc->mf6c_expire == 0) { 1287#ifdef MRT6DEBUG |
1278 if (mrt6debug & DEBUG_EXPIRE) | 1288 if (mrt6debug & DEBUG_EXPIRE) { 1289 char ip6bufo[INET6_ADDRSTRLEN]; 1290 char ip6bufg[INET6_ADDRSTRLEN]; |
1279 log(LOG_DEBUG, "expire_upcalls: expiring (%s %s)\n", | 1291 log(LOG_DEBUG, "expire_upcalls: expiring (%s %s)\n", |
1280 ip6_sprintf(&mfc->mf6c_origin.sin6_addr), 1281 ip6_sprintf(&mfc->mf6c_mcastgrp.sin6_addr)); | 1292 ip6_sprintf(ip6bufo, &mfc->mf6c_origin.sin6_addr), 1293 ip6_sprintf(ip6bufg, &mfc->mf6c_mcastgrp.sin6_addr)); 1294 } |
1282#endif 1283 /* 1284 * drop all the packets 1285 * free the mbuf with the pkt, if, timing info 1286 */ 1287 do { 1288 struct rtdetq *n = rte->next; 1289 m_freem(rte->m); --- 293 unchanged lines hidden (view full) --- 1583 * pMTU discovery is intentionally disabled by default, since 1584 * various router may notify pMTU in multicast, which can be 1585 * a DDoS to a router 1586 */ 1587 if (ip6_mcast_pmtu) 1588 icmp6_error(mb_copy, ICMP6_PACKET_TOO_BIG, 0, linkmtu); 1589 else { 1590#ifdef MRT6DEBUG | 1295#endif 1296 /* 1297 * drop all the packets 1298 * free the mbuf with the pkt, if, timing info 1299 */ 1300 do { 1301 struct rtdetq *n = rte->next; 1302 m_freem(rte->m); --- 293 unchanged lines hidden (view full) --- 1596 * pMTU discovery is intentionally disabled by default, since 1597 * various router may notify pMTU in multicast, which can be 1598 * a DDoS to a router 1599 */ 1600 if (ip6_mcast_pmtu) 1601 icmp6_error(mb_copy, ICMP6_PACKET_TOO_BIG, 0, linkmtu); 1602 else { 1603#ifdef MRT6DEBUG |
1591 if (mrt6debug & DEBUG_XMIT) | 1604 if (mrt6debug & DEBUG_XMIT) { 1605 char ip6bufs[INET6_ADDRSTRLEN]; 1606 char ip6bufd[INET6_ADDRSTRLEN]; |
1592 log(LOG_DEBUG, 1593 "phyint_send: packet too big on %s o %s " 1594 "g %s size %d(discarded)\n", 1595 if_name(ifp), | 1607 log(LOG_DEBUG, 1608 "phyint_send: packet too big on %s o %s " 1609 "g %s size %d(discarded)\n", 1610 if_name(ifp), |
1596 ip6_sprintf(&ip6->ip6_src), 1597 ip6_sprintf(&ip6->ip6_dst), | 1611 ip6_sprintf(ip6bufs, &ip6->ip6_src), 1612 ip6_sprintf(ip6bufd, &ip6->ip6_dst), |
1598 mb_copy->m_pkthdr.len); | 1613 mb_copy->m_pkthdr.len); |
1614 } |
|
1599#endif /* MRT6DEBUG */ 1600 m_freem(mb_copy); /* simply discard the packet */ 1601 } 1602 } 1603 1604 splx(s); 1605} 1606 --- 4 unchanged lines hidden (view full) --- 1611 struct mbuf *m; 1612{ 1613 struct mbuf *mm; 1614 int i, len = m->m_pkthdr.len; 1615 static struct sockaddr_in6 sin6 = { sizeof(sin6), AF_INET6 }; 1616 struct mrt6msg *im6; 1617 1618#ifdef MRT6DEBUG | 1615#endif /* MRT6DEBUG */ 1616 m_freem(mb_copy); /* simply discard the packet */ 1617 } 1618 } 1619 1620 splx(s); 1621} 1622 --- 4 unchanged lines hidden (view full) --- 1627 struct mbuf *m; 1628{ 1629 struct mbuf *mm; 1630 int i, len = m->m_pkthdr.len; 1631 static struct sockaddr_in6 sin6 = { sizeof(sin6), AF_INET6 }; 1632 struct mrt6msg *im6; 1633 1634#ifdef MRT6DEBUG |
1619 if (mrt6debug) | 1635 if (mrt6debug) { 1636 char ip6bufs[INET6_ADDRSTRLEN], ip6bufd[INET6_ADDRSTRLEN]; |
1620 log(LOG_DEBUG, "** IPv6 register_send **\n src %s dst %s\n", | 1637 log(LOG_DEBUG, "** IPv6 register_send **\n src %s dst %s\n", |
1621 ip6_sprintf(&ip6->ip6_src), ip6_sprintf(&ip6->ip6_dst)); | 1638 ip6_sprintf(ip6bufs, &ip6->ip6_src), 1639 ip6_sprintf(ip6bufd, &ip6->ip6_dst)); 1640 } |
1622#endif 1623 ++pim6stat.pim6s_snd_registers; 1624 1625 /* Make a copy of the packet to send to the user level process */ 1626 MGETHDR(mm, M_DONTWAIT, MT_HEADER); 1627 if (mm == NULL) 1628 return (ENOBUFS); 1629 mm->m_pkthdr.rcvif = NULL; --- 151 unchanged lines hidden (view full) --- 1781 * routing daemon. 1782 */ 1783 static struct sockaddr_in6 dst = { sizeof(dst), AF_INET6 }; 1784 1785 struct mbuf *mcp; 1786 struct ip6_hdr *eip6; 1787 u_int32_t *reghdr; 1788 int rc; | 1641#endif 1642 ++pim6stat.pim6s_snd_registers; 1643 1644 /* Make a copy of the packet to send to the user level process */ 1645 MGETHDR(mm, M_DONTWAIT, MT_HEADER); 1646 if (mm == NULL) 1647 return (ENOBUFS); 1648 mm->m_pkthdr.rcvif = NULL; --- 151 unchanged lines hidden (view full) --- 1800 * routing daemon. 1801 */ 1802 static struct sockaddr_in6 dst = { sizeof(dst), AF_INET6 }; 1803 1804 struct mbuf *mcp; 1805 struct ip6_hdr *eip6; 1806 u_int32_t *reghdr; 1807 int rc; |
1808#ifdef MRT6DEBUG 1809 char ip6bufs[INET6_ADDRSTRLEN], ip6bufd[INET6_ADDRSTRLEN]; 1810#endif |
|
1789 1790 ++pim6stat.pim6s_rcv_registers; 1791 1792 if ((reg_mif_num >= nummifs) || (reg_mif_num == (mifi_t) -1)) { 1793#ifdef MRT6DEBUG 1794 if (mrt6debug & DEBUG_PIM) 1795 log(LOG_DEBUG, 1796 "pim6_input: register mif not set: %d\n", --- 13 unchanged lines hidden (view full) --- 1810 */ 1811 if (pimlen < PIM6_REG_MINLEN) { 1812 ++pim6stat.pim6s_rcv_tooshort; 1813 ++pim6stat.pim6s_rcv_badregisters; 1814#ifdef MRT6DEBUG 1815 log(LOG_ERR, 1816 "pim6_input: register packet size too " 1817 "small %d from %s\n", | 1811 1812 ++pim6stat.pim6s_rcv_registers; 1813 1814 if ((reg_mif_num >= nummifs) || (reg_mif_num == (mifi_t) -1)) { 1815#ifdef MRT6DEBUG 1816 if (mrt6debug & DEBUG_PIM) 1817 log(LOG_DEBUG, 1818 "pim6_input: register mif not set: %d\n", --- 13 unchanged lines hidden (view full) --- 1832 */ 1833 if (pimlen < PIM6_REG_MINLEN) { 1834 ++pim6stat.pim6s_rcv_tooshort; 1835 ++pim6stat.pim6s_rcv_badregisters; 1836#ifdef MRT6DEBUG 1837 log(LOG_ERR, 1838 "pim6_input: register packet size too " 1839 "small %d from %s\n", |
1818 pimlen, ip6_sprintf(&ip6->ip6_src)); | 1840 pimlen, ip6_sprintf(ip6bufs, &ip6->ip6_src)); |
1819#endif 1820 m_freem(m); 1821 return (IPPROTO_DONE); 1822 } 1823 1824 eip6 = (struct ip6_hdr *) (reghdr + 1); 1825#ifdef MRT6DEBUG 1826 if (mrt6debug & DEBUG_PIM) 1827 log(LOG_DEBUG, 1828 "pim6_input[register], eip6: %s -> %s, " 1829 "eip6 plen %d\n", | 1841#endif 1842 m_freem(m); 1843 return (IPPROTO_DONE); 1844 } 1845 1846 eip6 = (struct ip6_hdr *) (reghdr + 1); 1847#ifdef MRT6DEBUG 1848 if (mrt6debug & DEBUG_PIM) 1849 log(LOG_DEBUG, 1850 "pim6_input[register], eip6: %s -> %s, " 1851 "eip6 plen %d\n", |
1830 ip6_sprintf(&eip6->ip6_src), 1831 ip6_sprintf(&eip6->ip6_dst), | 1852 ip6_sprintf(ip6bufs, &eip6->ip6_src), 1853 ip6_sprintf(ip6bufd, &eip6->ip6_dst), |
1832 ntohs(eip6->ip6_plen)); 1833#endif 1834 1835 /* verify the version number of the inner packet */ 1836 if ((eip6->ip6_vfc & IPV6_VERSION_MASK) != IPV6_VERSION) { 1837 ++pim6stat.pim6s_rcv_badregisters; 1838#ifdef MRT6DEBUG 1839 log(LOG_DEBUG, "pim6_input: invalid IP version (%d) " --- 7 unchanged lines hidden (view full) --- 1847 /* verify the inner packet is destined to a mcast group */ 1848 if (!IN6_IS_ADDR_MULTICAST(&eip6->ip6_dst)) { 1849 ++pim6stat.pim6s_rcv_badregisters; 1850#ifdef MRT6DEBUG 1851 if (mrt6debug & DEBUG_PIM) 1852 log(LOG_DEBUG, 1853 "pim6_input: inner packet of register " 1854 "is not multicast %s\n", | 1854 ntohs(eip6->ip6_plen)); 1855#endif 1856 1857 /* verify the version number of the inner packet */ 1858 if ((eip6->ip6_vfc & IPV6_VERSION_MASK) != IPV6_VERSION) { 1859 ++pim6stat.pim6s_rcv_badregisters; 1860#ifdef MRT6DEBUG 1861 log(LOG_DEBUG, "pim6_input: invalid IP version (%d) " --- 7 unchanged lines hidden (view full) --- 1869 /* verify the inner packet is destined to a mcast group */ 1870 if (!IN6_IS_ADDR_MULTICAST(&eip6->ip6_dst)) { 1871 ++pim6stat.pim6s_rcv_badregisters; 1872#ifdef MRT6DEBUG 1873 if (mrt6debug & DEBUG_PIM) 1874 log(LOG_DEBUG, 1875 "pim6_input: inner packet of register " 1876 "is not multicast %s\n", |
1855 ip6_sprintf(&eip6->ip6_dst)); | 1877 ip6_sprintf(ip6bufd, &eip6->ip6_dst)); |
1856#endif 1857 m_freem(m); 1858 return (IPPROTO_DONE); 1859 } 1860 1861 /* 1862 * make a copy of the whole header to pass to the daemon later. 1863 */ --- 12 unchanged lines hidden (view full) --- 1876 * forward the inner ip6 packet; point m_data at the inner ip6. 1877 */ 1878 m_adj(m, off + PIM_MINLEN); 1879#ifdef MRT6DEBUG 1880 if (mrt6debug & DEBUG_PIM) { 1881 log(LOG_DEBUG, 1882 "pim6_input: forwarding decapsulated register: " 1883 "src %s, dst %s, mif %d\n", | 1878#endif 1879 m_freem(m); 1880 return (IPPROTO_DONE); 1881 } 1882 1883 /* 1884 * make a copy of the whole header to pass to the daemon later. 1885 */ --- 12 unchanged lines hidden (view full) --- 1898 * forward the inner ip6 packet; point m_data at the inner ip6. 1899 */ 1900 m_adj(m, off + PIM_MINLEN); 1901#ifdef MRT6DEBUG 1902 if (mrt6debug & DEBUG_PIM) { 1903 log(LOG_DEBUG, 1904 "pim6_input: forwarding decapsulated register: " 1905 "src %s, dst %s, mif %d\n", |
1884 ip6_sprintf(&eip6->ip6_src), 1885 ip6_sprintf(&eip6->ip6_dst), | 1906 ip6_sprintf(ip6bufs, &eip6->ip6_src), 1907 ip6_sprintf(ip6bufd, &eip6->ip6_dst), |
1886 reg_mif_num); 1887 } 1888#endif 1889 1890 rc = if_simloop(mif6table[reg_mif_num].m6_ifp, m, 1891 dst.sin6_family, 0); 1892 1893 /* prepare the register head to send to the mrouting daemon */ --- 13 unchanged lines hidden --- | 1908 reg_mif_num); 1909 } 1910#endif 1911 1912 rc = if_simloop(mif6table[reg_mif_num].m6_ifp, m, 1913 dst.sin6_family, 0); 1914 1915 /* prepare the register head to send to the mrouting daemon */ --- 13 unchanged lines hidden --- |