Skip to content

Instantly share code, notes, and snippets.

View rbgarga's full-sized avatar

Renato Botelho rbgarga

View GitHub Profile
@rbgarga
rbgarga / -
Created September 26, 2013 20:04
Index: bsd.port.mk
===================================================================
--- bsd.port.mk (revision 328408)
+++ bsd.port.mk (working copy)
@@ -3943,8 +3943,12 @@
.if !target(install-package)
install-package:
+.if defined(FORCE_PKG_REGISTER)
+ @${PKG_ADD} -f ${PKGFILE}
Script started on Mon Sep 30 09:46:47 2013
command: make -C /usr/ports/devel/php53-pfSense-module TARGET_ARCH=amd64 BATCH=yes FORCE_PKG_REGISTER=yes OPTIONS_UNSET=X11 DOCS EXAMPLES MAN clean build install clean
===> Cleaning for php53-pfSense-module-0.1
if [ ! -d /usr/local/include/isc ]; then echo "Please reinstall isc-dhcp42-server port from pfPorts"; exit 1; fi
mkdir -p /usr/ports/devel/php53-pfSense-module/work/pfSense-0.1
cp -r files/* /usr/ports/devel/php53-pfSense-module/work/pfSense-0.1
===> Patching for php53-pfSense-module-0.1
===> php53-pfSense-module-0.1 depends on executable: dhcpd - found
===> php53-pfSense-module-0.1 depends on file: /usr/local/bin/phpize - found
===> php53-pfSense-module-0.1 depends on file: /usr/local/bin/autoconf-2.69 - found
@rbgarga
rbgarga / -
Created October 3, 2013 19:20
Index: Makefile
===================================================================
--- Makefile (revision 329186)
+++ Makefile (working copy)
@@ -197,7 +197,9 @@
#
# Elinks will try to use it if exists
#
-.if exists(${LOCALBASE}/include/execinfo.h)
+.if exists(/usr/include/execinfo.h)
6934 if (action == PF_PASS || r->action == PF_DROP) {
6935 dirndx = (dir == PF_OUT);
6936 r->packets[dirndx]++;
6937 r->bytes[dirndx] += pd.tot_len;
6938 if (a != NULL) {
6939 a->packets[dirndx]++;
6940 a->bytes[dirndx] += pd.tot_len;
6941 }
6942 if (s != NULL) {
6943 if (s->nat_rule.ptr != NULL) {
Index: Makefile
===================================================================
--- Makefile (revision 330510)
+++ Makefile (working copy)
@@ -14,9 +14,7 @@
LICENSE= AGPLv3 AL2
LICENSE_COMB= multi
-LIB_DEPENDS= execinfo:${PORTSDIR}/devel/libexecinfo \
- pcre:${PORTSDIR}/devel/pcre \
@rbgarga
rbgarga / -
Created October 28, 2013 21:28
diff --git a/etc/inc/gwlb.inc b/etc/inc/gwlb.inc
index 012b288..92b90f3 100644
--- a/etc/inc/gwlb.inc
+++ b/etc/inc/gwlb.inc
@@ -483,6 +483,8 @@ function return_gateways_array($disabled = false, $localhost = false) {
default:
if (substr($ifcfg['if'], 0, 4) == "ovpn")
$ctype = "VPNv4";
+ else if (substr($ifcfg['if'], 0, 3) == "gre")
+ $ctype = "GREv4";
@rbgarga
rbgarga / -
Last active December 28, 2015 21:59
diff --git a/etc/inc/filter.inc b/etc/inc/filter.inc
index 1fcd2f1..8e430e8 100644
--- a/etc/inc/filter.inc
+++ b/etc/inc/filter.inc
@@ -2954,7 +2954,10 @@ EOD;
$ipfrules .= "pass out route-to ( {$ifcfg['if']} {$gw} ) from {$ifcfg['ip']} to !{$ifcfg['sa']}/{$ifcfg['sn']} keep state allow-opts label \"let out anything from firewall host itself\"\n";
if (is_array($ifcfg['vips'])) {
foreach ($ifcfg['vips'] as $vip)
- $ipfrules .= "pass out route-to ( {$ifcfg['if']} {$gw} ) from {$vip['ip']} to !{$vip['ip']}/{$vip['sn']} keep state allow-opts label \"let out anything from firewall host itself\"\n";
diff --git a/etc/inc/filter.inc b/etc/inc/filter.inc
index 1fcd2f1..8e430e8 100644
--- a/etc/inc/filter.inc
+++ b/etc/inc/filter.inc
@@ -2954,7 +2954,10 @@ EOD;
$ipfrules .= "pass out route-to ( {$ifcfg['if']} {$gw} ) from {$ifcfg['ip']} to !{$ifcfg['sa']}/{$ifcfg['sn']} keep state allow-opts label \"let out anything from firewall host itself\"\n";
if (is_array($ifcfg['vips'])) {
foreach ($ifcfg['vips'] as $vip)
- $ipfrules .= "pass out route-to ( {$ifcfg['if']} {$gw} ) from {$vip['ip']} to !{$vip['ip']}/{$vip['sn']} keep state allow-opts label \"let out anything from firewall host itself\"\n";
+ if (ip_in_subnet($vip['ip'], "{$ifcfg['sa']}/{$ifcfg['sn']}"))
@rbgarga
rbgarga / -
Created December 4, 2013 14:04
diff --git a/etc/inc/pkg-utils.inc b/etc/inc/pkg-utils.inc
index 6de940a..f9fd268 100644
--- a/etc/inc/pkg-utils.inc
+++ b/etc/inc/pkg-utils.inc
@@ -1183,9 +1183,13 @@ function delete_package_xml($pkg) {
* If a require exists, include it. this will
* show us where an error exists in a package
* instead of making us blindly guess
+ *
+ * When we are upgrading all packages, we need
@rbgarga
rbgarga / gist:8184304
Created December 30, 2013 16:28
bad opt
Dec 30 14:25:47 pfs22amd64 pf: 00:02:55.897069 rule 75..16777216/0(match): pass in on vtnet0: (tos 0x0, ttl 64, id 32006, offset 0, flags [DF], proto TCP (6), length 60)
Dec 30 14:25:47 pfs22amd64 pf: 172.16.12.1.51366 > 172.16.12.240.443: Flags [S], cksum 0x7140 (incorrect -> 0x77b1), seq 2558776590, win 29200, options [mss 1460,sackOK,TS val 221292552 ecr 0,nop,wscale 7], length 0
Dec 30 14:25:47 pfs22amd64 filterlog: 75,16777216,,match,pass,in,4,0x0,,64,32006,0,DF,6,tcp,60,42696,47873,0S,2558776590,29200,[mss;[bad opt],>,