aboutsummaryrefslogtreecommitdiffstats
path: root/core/fs/pxe/tcp.c
diff options
context:
space:
mode:
authorMatt Fleming <matt.fleming@intel.com>2013-02-26 16:24:56 +0000
committerMatt Fleming <matt.fleming@intel.com>2013-03-06 17:04:39 +0000
commit16aa878d78086e9bc1c1f1053dc24da295f81e05 (patch)
tree3da29f8f502ec1014105c565985848ea18d7ce92 /core/fs/pxe/tcp.c
parent990f1ace09e79f99a196574f60e5484a5bb4a2d4 (diff)
downloadsyslinux-16aa878d78086e9bc1c1f1053dc24da295f81e05.tar.gz
syslinux-16aa878d78086e9bc1c1f1053dc24da295f81e05.tar.xz
syslinux-16aa878d78086e9bc1c1f1053dc24da295f81e05.zip
net: Return of the legacy network stack
While it's nice having the shiny new lwIP stack, there is definitely merit in being able to choose between two different network stacks. We want to keep the legacy network stack around as it is known to handle funky BIOS implementations and provides a good reference point when bugs are suspected in the lwIP code. Users now have a choice of .0 files. pxelinux.0 uses the legacy network stack, while lpxelinux.0 uses lwIP. Note that not every protocol is converted to using this new API. The http, ftp and tcp code is still inherently tied to the netconn API, and is only available with lpxelinux.0 and the lwIP stack. It's unlikely that this code will ever be fixed up to work with the legacy network stack. Network stack operations are abstracted behind the net_core_* interface, and each network stack has private data fields contained within a struct net_private. Cc: H. Peter Anvin <hpa@zytor.com> Cc: Eric W. Biederman <ebiederm@xmission.com> Cc: Gene Cumm <gene.cumm@gmail.com> Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Diffstat (limited to 'core/fs/pxe/tcp.c')
-rw-r--r--core/fs/pxe/tcp.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/core/fs/pxe/tcp.c b/core/fs/pxe/tcp.c
index ec7679e7..528fbce8 100644
--- a/core/fs/pxe/tcp.c
+++ b/core/fs/pxe/tcp.c
@@ -25,13 +25,13 @@ void tcp_close_file(struct inode *inode)
{
struct pxe_pvt_inode *socket = PVT(inode);
- if (socket->conn) {
- netconn_delete(socket->conn);
- socket->conn = NULL;
+ if (socket->private.conn) {
+ netconn_delete(socket->private.conn);
+ socket->private.conn = NULL;
}
- if (socket->buf) {
- netbuf_delete(socket->buf);
- socket->buf = NULL;
+ if (socket->private.buf) {
+ netbuf_delete(socket->private.buf);
+ socket->private.buf = NULL;
}
}
@@ -43,16 +43,16 @@ void tcp_fill_buffer(struct inode *inode)
err_t err;
/* Clean up or advance an inuse netbuf */
- if (socket->buf) {
- if (netbuf_next(socket->buf) < 0) {
- netbuf_delete(socket->buf);
- socket->buf = NULL;
+ if (socket->private.buf) {
+ if (netbuf_next(socket->private.buf) < 0) {
+ netbuf_delete(socket->private.buf);
+ socket->private.buf = NULL;
}
}
/* If needed get a new netbuf */
- if (!socket->buf) {
- err = netconn_recv(socket->conn, &(socket->buf));
- if (!socket->buf || err) {
+ if (!socket->private.buf) {
+ err = netconn_recv(socket->private.conn, &(socket->private.buf));
+ if (!socket->private.buf || err) {
socket->tftp_goteof = 1;
if (inode->size == -1)
inode->size = socket->tftp_filepos;
@@ -61,7 +61,7 @@ void tcp_fill_buffer(struct inode *inode)
}
}
/* Report the current fragment of the netbuf */
- err = netbuf_data(socket->buf, &data, &len);
+ err = netbuf_data(socket->private.buf, &data, &len);
if (err) {
printf("netbuf_data err: %d\n", err);
kaboom();