PERFORCE change 113775 for review

Paolo Pisati piso at FreeBSD.org
Wed Jan 31 16:40:25 UTC 2007


http://perforce.freebsd.org/chv.cgi?CH=113775

Change 113775 by piso at piso_newluxor on 2007/01/31 16:40:09

	Start filling in mbuf placeholders i left around: ProtoAliasIn() and ProtoAliasOut() first.

Affected files ...

.. //depot/projects/soc2005/libalias/sys/netinet/libalias/alias.c#44 edit

Differences ...

==== //depot/projects/soc2005/libalias/sys/netinet/libalias/alias.c#44 (text+ko) ====

@@ -692,8 +692,11 @@
 	struct ip *pip;
 	struct alias_link *lnk;
 #ifdef _KERNEL
-	// XXX - m_pullup()
-	pip = ptr;
+	struct mbuf *m;
+	m = m_pullup(ptr, sizeof(struct ip));
+	if (m == NULL)
+		return (PKT_ALIAS_IGNORED);
+	pip = mtod(m, struct ip *);
 #else
 	pip = ptr;
 #endif
@@ -731,8 +734,11 @@
 	struct alias_link *lnk;
 	struct ip *pip;
 #ifdef _KERNEL
-	// XXX m_pullup()
-	pip = ptr;
+	struct mbuf *m;
+	m = m_pullup(ptr, sizeof(struct ip));
+	if (m == NULL)
+		return (PKT_ALIAS_IGNORED);
+	pip = mtod(m, struct ip *);
 #else
 	pip = ptr;
 #endif
@@ -1368,11 +1374,11 @@
 			if (error ==  0)
 				iresult = PKT_ALIAS_OK;
 			else
-				iresult = ProtoAliasIn(la, pip);
+				iresult = ProtoAliasIn(la, ptr);
 		}
  			break; 
 		default:
-			iresult = ProtoAliasIn(la, pip);
+			iresult = ProtoAliasIn(la, ptr);
 			break;
 		}
 
@@ -1509,11 +1515,11 @@
 			if (error == 0)
  				iresult = PKT_ALIAS_OK;
  			else
- 				iresult = ProtoAliasOut(la, pip, create);
+ 				iresult = ProtoAliasOut(la, ptr, create);
 		}
  			break;
 		default:
-			iresult = ProtoAliasOut(la, pip, create);
+			iresult = ProtoAliasOut(la, ptr, create);
 			break;
 		}
 	} else {


More information about the p4-projects mailing list