Print this page
5045 use atomic_{inc,dec}_* instead of atomic_add_*


1541         else if (ire->ire_type & IRE_BROADCAST)
1542                 return (ire_send_broadcast_v4(ire, mp, ipha, ixa, identp));
1543         else
1544                 return (ire_send_wire_v4(ire, mp, ipha, ixa, identp));
1545 }
1546 
1547 /*
1548  * ire_sendfn for IREs with RTF_REJECT/RTF_BLACKHOLE, including IRE_NOROUTE
1549  */
1550 int
1551 ire_send_noroute_v4(ire_t *ire, mblk_t *mp, void *iph_arg,
1552     ip_xmit_attr_t *ixa, uint32_t *identp)
1553 {
1554         ip_stack_t      *ipst = ixa->ixa_ipst;
1555         ipha_t          *ipha = (ipha_t *)iph_arg;
1556         ill_t           *ill;
1557         ip_recv_attr_t  iras;
1558         boolean_t       dummy;
1559 
1560         /* We assign an IP ident for nice errors */
1561         ipha->ipha_ident = atomic_add_32_nv(identp, 1);
1562 
1563         BUMP_MIB(&ipst->ips_ip_mib, ipIfStatsOutNoRoutes);
1564 
1565         if (ire->ire_type & IRE_NOROUTE) {
1566                 /* A lack of a route as opposed to RTF_REJECT|BLACKHOLE */
1567                 ip_rts_change(RTM_MISS, ipha->ipha_dst, 0, 0, 0, 0, 0, 0,
1568                     RTA_DST, ipst);
1569         }
1570 
1571         if (ire->ire_flags & RTF_BLACKHOLE) {
1572                 ip_drop_output("ipIfStatsOutNoRoutes RTF_BLACKHOLE", mp, NULL);
1573                 freemsg(mp);
1574                 /* No error even for local senders - silent blackhole */
1575                 return (0);
1576         }
1577         ip_drop_output("ipIfStatsOutNoRoutes RTF_REJECT", mp, NULL);
1578 
1579         /*
1580          * We need an ill_t for the ip_recv_attr_t even though this packet
1581          * was never received and icmp_unreachable doesn't currently use




1541         else if (ire->ire_type & IRE_BROADCAST)
1542                 return (ire_send_broadcast_v4(ire, mp, ipha, ixa, identp));
1543         else
1544                 return (ire_send_wire_v4(ire, mp, ipha, ixa, identp));
1545 }
1546 
1547 /*
1548  * ire_sendfn for IREs with RTF_REJECT/RTF_BLACKHOLE, including IRE_NOROUTE
1549  */
1550 int
1551 ire_send_noroute_v4(ire_t *ire, mblk_t *mp, void *iph_arg,
1552     ip_xmit_attr_t *ixa, uint32_t *identp)
1553 {
1554         ip_stack_t      *ipst = ixa->ixa_ipst;
1555         ipha_t          *ipha = (ipha_t *)iph_arg;
1556         ill_t           *ill;
1557         ip_recv_attr_t  iras;
1558         boolean_t       dummy;
1559 
1560         /* We assign an IP ident for nice errors */
1561         ipha->ipha_ident = atomic_inc_32_nv(identp);
1562 
1563         BUMP_MIB(&ipst->ips_ip_mib, ipIfStatsOutNoRoutes);
1564 
1565         if (ire->ire_type & IRE_NOROUTE) {
1566                 /* A lack of a route as opposed to RTF_REJECT|BLACKHOLE */
1567                 ip_rts_change(RTM_MISS, ipha->ipha_dst, 0, 0, 0, 0, 0, 0,
1568                     RTA_DST, ipst);
1569         }
1570 
1571         if (ire->ire_flags & RTF_BLACKHOLE) {
1572                 ip_drop_output("ipIfStatsOutNoRoutes RTF_BLACKHOLE", mp, NULL);
1573                 freemsg(mp);
1574                 /* No error even for local senders - silent blackhole */
1575                 return (0);
1576         }
1577         ip_drop_output("ipIfStatsOutNoRoutes RTF_REJECT", mp, NULL);
1578 
1579         /*
1580          * We need an ill_t for the ip_recv_attr_t even though this packet
1581          * was never received and icmp_unreachable doesn't currently use