]> git.ipfire.org Git - people/stevee/network.git/commitdiff
Fixed some issues with pppoe dial-in.
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 3 Jun 2011 20:55:14 +0000 (20:55 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 3 Jun 2011 20:55:14 +0000 (20:55 +0000)
No major stuff. Just some fixes for invalid input.

functions.ppp
functions.routing
hooks/zones/pppoe

index 00015aef97d6ce8d632c6cc578add3d8e71cce2a..ca6c4e0342183368cc355a3ad030fc2c775a767c 100644 (file)
@@ -34,7 +34,8 @@ function ppp_common_ip_pre_up() {
                return ${EXIT_ERROR}
        fi
 
-       routing_db_from_ppp ${zone}
+       # XXX protocol hardcoded
+       routing_db_from_ppp ${zone} ipv4
 
        # Request firewall reload
        event_firewall_reload
@@ -51,8 +52,9 @@ function ppp_common_ip_up() {
                return ${EXIT_ERROR}
        fi
 
-       routing_db_set ${zone} active 1
-       red_routing_update ${zone}
+       # XXX protocol is hardcoded
+       routing_db_set ${zone} ipv4 active 1
+       routing_update ${zone} ipv4
 
        # Emit interface-up event
        event_interface_up ${zone}
index d94592673429af4db8d44c9cc1809dc103b8f07a..9d59e6d1ede7dec71c6e2c1cf54ced3700ca4bda 100644 (file)
@@ -149,6 +149,9 @@ function routing_db_from_ppp() {
        local zone=${1}
        local proto=${2}
 
+       assert isset zone
+       assert isset proto
+
        # Save ppp configuration
        routing_db_set ${zone} ${proto} type "ppp"
        routing_db_set ${zone} ${proto} local-ip-address ${PPP_IPLOCAL}
@@ -161,6 +164,7 @@ function routing_db_from_ppp() {
 
 function routing_update() {
        local zone=${1}
+       assert isset zone
 
        # Nothing to do for local zones.
        if zone_is_local ${zone}; then
@@ -169,6 +173,7 @@ function routing_update() {
 
        local proto=${2}
        local table=${zone}
+       assert isset proto
 
        # Create routing table if not exists
        routing_table_create ${table}
index 895e1edd0c5bb02987fe83c72bc97ff591a14e4f..c3640811c0457fbf8ae757de5130c89e1d502e4f 100755 (executable)
@@ -176,6 +176,10 @@ EOF
                        log DEBUG "pppd detached successfully"
                        exit ${EXIT_OK}
                        ;;
+               19)
+                       log ERROR "Authentication failed. Maybe user and/or secret is/are incorrect."
+                       exit ${EXIT_ERROR}
+                       ;;
        esac
 
        error_log "pppd exited with unknown exit code '${ret}'"