Chinaunix首页 | 论坛 | 博客
  • 博客访问: 464856
  • 博文数量: 100
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 955
  • 用 户 组: 普通用户
  • 注册时间: 2014-11-21 09:30
文章分类

全部博文(100)

文章存档

2017年(1)

2016年(16)

2015年(83)

我的朋友

分类: 嵌入式

2015-05-06 18:04:30

使用三星的u-boot 1.3.4 (s5pv210)进行tftp下载时会报错Unsupported option(s) requested。
抓包,对比数据包:
1.  出错时:
4141    165.004439    192.168.1.74    192.168.1.72    TFTP    88    Read Request, File: u-boot.bin, Transfer type: octet, timeout\000=5000\000, blksize\000=1468\000
4142    165.005507    192.168.1.72    192.168.1.74    TFTP    78    Error Code, Code: Option negotiation failed, Message: Unsupported option(s) requested

63    11.973278    192.168.1.74    192.168.1.72    TFTP    87    Read Request, File: u-boot.bin, Transfer type: octet, timeout\000=5000\000, blksize\000=1468\000

2.  当使用xp的tftp32作为服务器时,能正常下载(说明tftp32兼容性较好):
1052    188.354447    192.168.1.74    192.168.1.73    TFTP    87    Read Request, File: u-boot.bin, Transfer type: octet, timeout\000=5000\000, blksize\000=1468\000

3.  使用uboot2015的正常tftp数据包为:
5162    307.915968    192.168.1.74    192.168.1.72    TFTP    84    Read Request, File: u-boot.bin, Transfer type: octet, timeout\000=5\000, blksize\000=1468\000
5163    307.916477    192.168.1.72    192.168.1.74    TFTP    67    Option Acknowledgement, timeout\000=5\000, blksize\000=1468\000

对比可以发现timeout不能设置为5000UL
解决办法:修改net/tftp.c源码中
#define TIMEOUT         5000UL
修改为:#define TIMEOUT 5UL

补充:实际上,更换tftp服务器软件也能解决该问题,根据我的经验,
linux下的openbsd-inetd和windows下的tftp32这2款软件兼容性较好
阅读(2977) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~