diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2009-12-20 02:57:31 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2009-12-20 02:57:31 +0000 |
commit | 9fbd8df110874ad6324e9be5862e8558a30880bc (patch) | |
tree | ec1f8b46748a3e9a2a099e8ecc39d638252046fe /contrib/fwd/src/fwd.c | |
parent | d77076aa1653133e78619351ed41f721d4f59dd2 (diff) |
contrib/fwd: remove debug prints, add syslog info
Diffstat (limited to 'contrib/fwd/src/fwd.c')
-rw-r--r-- | contrib/fwd/src/fwd.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/contrib/fwd/src/fwd.c b/contrib/fwd/src/fwd.c index 0b25cb038..662524e35 100644 --- a/contrib/fwd/src/fwd.c +++ b/contrib/fwd/src/fwd.c @@ -106,19 +106,31 @@ static int fwd_server_main(int argc, const char *argv[]) if( !fwd_empty_cidr(addr_new) && fwd_empty_cidr(addr_old) ) { - printf("IFUP[%s]\n", net->ifname); + fwd_log_info( + "Interface %s brought up - adding rules", + net->ifname + ); + fwd_update_cidr(addr_old, addr_new); fwd_ipt_addif(h, net->name); } else if( fwd_empty_cidr(addr_new) && !fwd_empty_cidr(addr_old) ) { - printf("IFDOWN[%s]\n", net->ifname); + fwd_log_info( + "Interface %s went down - removing rules", + net->ifname + ); + fwd_update_cidr(addr_old, NULL); fwd_ipt_delif(h, net->name); } else if( ! fwd_equal_cidr(addr_old, addr_new) ) { - printf("IFCHANGE[%s]\n", net->ifname); + fwd_log_info( + "Interface %s changed IP - rebuilding rules", + net->ifname + ); + fwd_update_cidr(addr_old, addr_new); fwd_ipt_chgif(h, net->name); } |