Author: tuexen
Date: Fri Feb 10 23:41:37 2012
New Revision: 231479
URL: http://svn.freebsd.org/changeset/base/231479

Log:
  MFC r227655:
  Cleanup comparison of interface names.

Modified:
  stable/8/sys/netinet/sctp_pcb.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/boot/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/e1000/   (props changed)

Modified: stable/8/sys/netinet/sctp_pcb.c
==============================================================================
--- stable/8/sys/netinet/sctp_pcb.c     Fri Feb 10 23:38:38 2012        
(r231478)
+++ stable/8/sys/netinet/sctp_pcb.c     Fri Feb 10 23:41:37 2012        
(r231479)
@@ -331,19 +331,9 @@ sctp_mark_ifa_addr_down(uint32_t vrf_id,
                goto out;
        }
        if (if_name) {
-               int len1, len2;
-
-               len1 = strlen(if_name);
-               len2 = strlen(sctp_ifap->ifn_p->ifn_name);
-               if (len1 != len2) {
-                       SCTPDBG(SCTP_DEBUG_PCB4, "IFN of ifa names different 
length %d vs %d - ignored\n",
-                           len1, len2);
-                       goto out;
-               }
-               if (strncmp(if_name, sctp_ifap->ifn_p->ifn_name, len1) != 0) {
+               if (strncmp(if_name, sctp_ifap->ifn_p->ifn_name, SCTP_IFNAMSIZ) 
!= 0) {
                        SCTPDBG(SCTP_DEBUG_PCB4, "IFN %s of IFA not the same as 
%s\n",
-                           sctp_ifap->ifn_p->ifn_name,
-                           if_name);
+                           sctp_ifap->ifn_p->ifn_name, if_name);
                        goto out;
                }
        } else {
@@ -384,19 +374,9 @@ sctp_mark_ifa_addr_up(uint32_t vrf_id, s
                goto out;
        }
        if (if_name) {
-               int len1, len2;
-
-               len1 = strlen(if_name);
-               len2 = strlen(sctp_ifap->ifn_p->ifn_name);
-               if (len1 != len2) {
-                       SCTPDBG(SCTP_DEBUG_PCB4, "IFN of ifa names different 
length %d vs %d - ignored\n",
-                           len1, len2);
-                       goto out;
-               }
-               if (strncmp(if_name, sctp_ifap->ifn_p->ifn_name, len1) != 0) {
+               if (strncmp(if_name, sctp_ifap->ifn_p->ifn_name, SCTP_IFNAMSIZ) 
!= 0) {
                        SCTPDBG(SCTP_DEBUG_PCB4, "IFN %s of IFA not the same as 
%s\n",
-                           sctp_ifap->ifn_p->ifn_name,
-                           if_name);
+                           sctp_ifap->ifn_p->ifn_name, if_name);
                        goto out;
                }
        } else {
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to