diff options
author | abs <abs> | 1999-11-05 13:52:50 +0000 |
---|---|---|
committer | abs <abs> | 1999-11-05 13:52:50 +0000 |
commit | fd620edf8de186cfaf54ce056b1107acebd10a5f (patch) | |
tree | 30702d0e9265ad6c8a8a1d38b686032b88334584 /sysutils/cfengine/patches | |
parent | c045078fc51a25fb59ddc1ea8e98324bd0889b84 (diff) | |
download | pkgsrc-fd620edf8de186cfaf54ce056b1107acebd10a5f.tar.gz |
Add cfengine to sysutils SUBDIRS
Add patches to set the correct Class based on the netmask (in the process of
submitting all patches back to the maintainer)
Diffstat (limited to 'sysutils/cfengine/patches')
-rw-r--r-- | sysutils/cfengine/patches/patch-ac | 11 | ||||
-rw-r--r-- | sysutils/cfengine/patches/patch-ad | 44 |
2 files changed, 55 insertions, 0 deletions
diff --git a/sysutils/cfengine/patches/patch-ac b/sysutils/cfengine/patches/patch-ac new file mode 100644 index 00000000000..62b7cd50ffb --- /dev/null +++ b/sysutils/cfengine/patches/patch-ac @@ -0,0 +1,11 @@ +$NetBSD: patch-ac,v 1.1 1999/11/05 13:52:52 abs Exp $ +--- src/install.c.orig Fri Nov 5 06:44:50 1999 ++++ src/install.c Fri Nov 5 10:38:31 1999 +@@ -153,6 +153,7 @@ + FatalError("Redefinition of basic system variable"); + } + strcpy(VNETMASK,value); ++ AddNetworkClass(VNETMASK); + break; + + diff --git a/sysutils/cfengine/patches/patch-ad b/sysutils/cfengine/patches/patch-ad new file mode 100644 index 00000000000..b4e45c6d49b --- /dev/null +++ b/sysutils/cfengine/patches/patch-ad @@ -0,0 +1,44 @@ +$NetBSD: patch-ad,v 1.1 1999/11/05 13:52:52 abs Exp $ +--- src/misc.c.orig Fri Nov 5 06:44:40 1999 ++++ src/misc.c Fri Nov 5 10:37:17 1999 +@@ -652,3 +652,40 @@ + + AddClassToHeap(CanonifyName(VDOMAIN)); + } ++ ++/*********************************************************************/ ++ ++AddNetworkClass(netmask) ++ ++const char *netmask; ++ ++{ ++struct in_addr ip, ++ nm; ++char *sp, ++ nmbuf[maxvarsize], ++ ipbuf[maxvarsize]; ++ ++ /* ++ * Has to differentiate between cases such as: ++ * 192.168.101.1/24 -> 192.168.101 and ++ * 192.168.101.1/26 -> 192.168.101.0 ++ * We still have the, um... 'interesting' Class C default Network Class ++ * set by GetNameInfo() ++ */ ++ ++ /* This is also a convenient method to ensure valid dotted quad */ ++if (inet_aton(netmask,&nm) && inet_aton(VIPADDRESS,&ip)) ++ { ++ ip.s_addr &= nm.s_addr; /* Will not work with IPv6 */ ++ strcpy(ipbuf,inet_ntoa(ip)); ++ ++ strcpy(nmbuf,inet_ntoa(nm)); ++ while( (sp = strrchr(nmbuf,'.')) && strcmp(sp,".0") == 0 ) ++ { ++ *sp = 0; ++ *strrchr(ipbuf,'.') = 0; ++ } ++ AddClassToHeap(CanonifyName(ipbuf)); ++ } ++} |