From mboxrd@z Thu Jan 1 00:00:00 1970 From: "C.J" Date: Wed, 04 Jun 2008 01:17:37 +0000 Subject: cannot connect to pppoe socket Message-Id: <200806040917337962954@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-ppp@vger.kernel.org Hi all, There is a test demo code for making a 'pppoe socket' and connect it. In my machine it cannot connect well but some others not. >>>>> code below(some headers are useless here): #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include int main(void) { struct sockaddr_pppox sp; int sock; /* Make the session socket */ sock = socket(AF_PPPOX, SOCK_STREAM, PX_PROTO_OE); sp.sa_family = AF_PPPOX; sp.sa_protocol = PX_PROTO_OE; sp.sa_addr.pppoe.sid = 1; memcpy(sp.sa_addr.pppoe.dev, "eth1", 16); memcpy(sp.sa_addr.pppoe.remote, "\x00\x00\x00\x00\x00\x00", 6); if (sock > 0) printf("socket succ\n"); else return -1; if (connect(sock, (struct sockaddr *) &sp, sizeof(struct sockaddr_pppox)) < 0) { printf("connect err\n"); return -1; } printf("connect succ\n"); return 0; } <<<<<<< Any info? I want to get 'pppoe socket' depend which environment. Reg -- c.j